I would like to create a quiz which reporting is on a google sheet.
Following your instructions on https://atomisystems.com/elearning/send-quiz-report-google-sheets-email/
i made it and everything works fine but i would like to make some changes.
For example i would like to collect some informations such as name, surname, email, ecc. of the learner. I used the filli in blank tools, but then in the details on Google sheet, it does not appear.
What type of interaction do you suggest me for doing this? Anything else to do?
Please use the Text Box (Interactions -> TextBox) interaction to store that information. You should settings the reporting option of the text box like below:
In Google Script, please look up this interaction by its ReportID to get the data.
// Fill details report information
var reportDetails = report["Details"];
headers = sheet.getRange("A20:I20").getValues();
values = sheet.getRange("A20:I20").getValues();
var userName;
for (var row = 0; row < reportDetails.length; row++) {
for (var i = 0; i < headers[0].length; i++) {
// Find the username, email... data here
var reportID = JSON.stringify(reportDetails[row]['ReportID']);
if (reportID == 'UserName') {
userName = JSON.stringify(reportDetails[row]['ReportID']);
}
values[0][i] = JSON.stringify(reportDetails[row][headers[0][i]]);
}
var nextRow = 21 + row;
var range = "A" + nextRow.toString() + ":" + "I" + nextRow.toString();
sheet.getRange(range).setValues(values);
}
Hi.
Is it possible to send the results of the quiz to the google sheet without the last pop up? (that is, when the quiz is over, pressing the button, data is send to the sheet directly)
I’m not sure if I understand your question correctly.
If you want to collect the user id yourself (without poping up a dialog at the end of the quiz), you can use a text entry box as @namnt’s answer, and disable the user-id popup as in my answer above.
The code $.cookie(‘userid’, ‘dummyId’); unfortunately doesn’t work for me in Google Chrome (working on Mac). The popup gets blocked in Safari and Firefox and the report is successfully sent to my email-address. In Chrome it still appears and I get an error when sending the report.
(I exported the test to HTML5 and host the test on a Webpage.)
We can’t reproduce this issue in Google Chrome on Mac machines.
Please make sure that you open your HTML5 via http/https protocol, viewing directly from the local html file (via file protocol) will not work on some browsers.
I can successfully report the quiz result on Google sheet. However, it reports the quiz result only when it reaches the last slide and everything will stop there. Is it possible to report the quiz result on any slide by clicking the button?
You can add an Execute JavaScript action with the script prez.sendReport(); to a button On Click event to send the report when the button is clicked.
Please note that the entire report at that time will be sent, so you should check and make changes to your Google Apps script (if needed) to make sure the later report of a user will overwrite his/her earlier reports (so that only the latest one is stored).
You may also need to add the following script to ActivePresenter > Project > Properties > Event to hide any messages displayed when sending the report: