get google forms quiz viewscore url

97 views
Skip to first unread message

Nicola Cantalupo

unread,
Apr 21, 2020, 7:44:52 AM4/21/20
to Google Apps Script Community
from google classroom, the teacher assigned a quiz (google forms) to his students. after assigning a score to the answers and leaving a feedback, the teacher publishes the score. the student will receive an email with the score and a link to see the feedback left by the teacher. some students don't receive this link. is it possible to generate it?

Nicola Cantalupo

unread,
Apr 25, 2020, 2:33:05 PM4/25/20
to Google Apps Script Community
Is mine an absurd request?

CBMServices Web

unread,
Apr 25, 2020, 3:24:06 PM4/25/20
to google-apps-sc...@googlegroups.com
Nicola,

This is quite doable. It can be done with one form which both student and teacher modify the same entry.

You will need code to inform teacher when student fills form, then another notification to student when teacher fills out the score and comments in the form.

The URL of the form answer can be generated via a call to FormApp.

Let me know if you need help with this.

On Sat., Apr. 25, 2020, 11:33 a.m. Nicola Cantalupo, <nicolac...@gmail.com> wrote:
Is mine an absurd request?

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/7786a520-a07f-446d-8a8f-b9ca47914d58%40googlegroups.com.

Nicola Cantalupo

unread,
Apr 29, 2020, 11:28:59 AM4/29/20
to google-apps-sc...@googlegroups.com
the form under discussion has already been created, the pupils have already answered the questions and the teacher has already corrected everything. perhaps I should first of all understand how the URL of the form is structured (in score and feedback display) for each pupil. 

George

unread,
Apr 29, 2020, 2:22:07 PM4/29/20
to Google Apps Script Community
Here is a short bit function I use to get the URL of a form response. The way the URL works is it points to a specific response of the form. If the form allows people to edit their previous responses, then it will allow them to view and modify what was there. The function expects the form Id and the timestamp of the response (this is usually saved by Google Forms in the first column in the spreadsheet (assuming you have the responses saved to a spreadsheet).

function GetEditURL(index, formId)
{
 
var form = FormApp.openById(formId);
 
var editURL = " ";
 
var formSubmitted = form.getResponses(index);
 
if(formSubmitted.length > 0)
 
{
    editURL
= formSubmitted[0].getEditResponseUrl();
 
}
 
else
 
{
    sendEmail
(errorEmail,"GetEditURL Error", "Failed to get Edit URL" + formId + " " + index, null, false)
 
};
 
return editURL;
 
};



On Wednesday, April 29, 2020 at 8:28:59 AM UTC-7, Nicola Cantalupo wrote:
the form under discussion has already been created, the pupils have already answered the questions and the teacher has already corrected everything. perhaps I should first of all understand how the URL of the form is structured (in score and feedback display) for each pupil. 

Il sab 25 apr 2020, 21:24 CBMServices Web <cbmserv...@gmail.com> ha scritto:
Nicola,

This is quite doable. It can be done with one form which both student and teacher modify the same entry.

You will need code to inform teacher when student fills form, then another notification to student when teacher fills out the score and comments in the form.

The URL of the form answer can be generated via a call to FormApp.

Let me know if you need help with this.

On Sat., Apr. 25, 2020, 11:33 a.m. Nicola Cantalupo, <nicolac...@gmail.com> wrote:
Is mine an absurd request?

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Kim Nilsson

unread,
Apr 30, 2020, 9:40:09 AM4/30/20
to Google Apps Script Community
Thanks, George.

What extra code is needed to turn your example into a function that looks through column A and posts all EditURLs in column AA of the answer sheet?

George

unread,
Apr 30, 2020, 1:47:11 PM4/30/20
to Google Apps Script Community
Hi Kim,

 In several applications I wrote, I actually do store the URL in the same spreadsheet as the form submissions. But I keep the reading/writing of the spreadsheet outside of that function or else would need to pass in more parms.

here is what I do:
  var lastCol = s.getLastColumn();
 
var sheetData = s.getRange(row,1,1, lastCol).getValues()[0];  // grab the whole row of data submitted
 
var editURL = GetEditURL(sheetData[0], formId);  // index 0 of the data is Column A
  s
.getRange(row, editURLCol).setValue(editURL);  // store URL in column of your choosing. editURLCol is variable for me depending on spreadsheet.

Column AA would be column 27 of that row.

 Have fun.

Kim Nilsson

unread,
Apr 30, 2020, 3:02:39 PM4/30/20
to Google Apps Script Community
Thanks.
If I'm reading that right, I would need to add some for-loop to walk down all existing column A values.
I think I get it.

CBMServices Web

unread,
Apr 30, 2020, 3:21:00 PM4/30/20
to google-apps-sc...@googlegroups.com
Yep, just loop over row numbers and that should do it.



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/05f1bf9f-b7e4-4109-a2cf-a514ae086a03%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages