Forum Discussion
exporting variables to be read in a Google docs spreadsheet
I've seen Tom's helpful screencast on how to embed a Google docs form into a Storyline project. However, what I want to do is a little different. I'd like to be able to export the values of about a dozen variables from Storyline so I could see them in a spreadsheet the way I would if students entered those values into a Google docs form.
I've got a grammar assessment, and I want to export a student's name and either OK/NEED TO REVIEW/MIGHT WANT TO REVIEW for each of a dozen or so topics. Now, I could just use a final page screen in Storyline showing a student her status on these dozen topics and ask her to fill out an embedded Google docs form in which she basically copies the results manually. These are just initial assessment scores, and I'm not worried about honesty issues. However, this seems like a pretty klutzy way to do things. Would anyone be able to help me out with a suggestion for a better method? I don't know any JavaScript, and my familiarity with Storyline is fairly low.
Thanks!
Dorothy
142 Replies
- ainemeehan1Community Member
i can zip the orig and dropbox it to you if you send me your e-mail address
- andreaestanga-4Community Member
Hello Aine,
Sorry for the late response. I don't think I got your email when you replied. .. What I did at the end was that I turned off the option to launch it with Articulate mobile player. That's how I got it to work. Now it exports the variables from the ipad without eny problem
- NigelYoungKanukCommunity Member
Thanks to everyone in this thread - I've been asked to do this for a client and got it working eventually following those who have gone before me. Anyone wanting my 'steps' and script please direct message me and I'll happily share :) Great to say it tested on FF, Chrome, Safari, IE and mobile safari too.
- andreaestanga-4Community Member
Hello Nigel,
Great work. Are you using Articulate mobile player?
- NigelYoungKanukCommunity Member
No, I use HTML5 and turn off the options for the mobile player (not a fan actually and prefer the web version). I understand it won't work with the mobile player anyway...
Thanks Nigel for offering to help others here and I'm glad you figured out a way to make it work!
- ainemeehan1Community Member
Hi everyone. I got this to work, the problem I had was that I was actually trying to export quiz results, which from reading around appears to be a protected field in Articulate. Can anyone collaborate that. So I spent days trying to figure it out, and it turned out I was not doing anything wrong, it was just the field I was trying to export as a variable. There was a work around somewhere that I found online but that didn't work either.
- MarkWeingarten-Community Member
Hi Everyone,
I'm having a heck of a time finding the X, Y, and Z information as indicated in the steps outlined below:
"XXXXXXXXXXXXXXXXXXX - must be replaced by the form key (for more details chceck pdf file)
yyyyy, zzzzz - must be replaced by number from your's google form. You can find it with firebug (for more details chceck pdf file)"
I tried following the directions on the link (https://articulate-heroes.s3.amazonaws.com/uploads/attachment/attachment_url/4238/page.pdf?dl=true) that was shared but I can't find the form key or the y and z numbers.
Could anyone help? I'm hoping to get this working soon.
Thanks,
Mark
- MarkWeingarten-Community Member
After quite a bit of fiddling around and a dash of close reading, I was able to get it to work. Thanks so much to all of the previous posters. I couldn't have done it (at all!) without your help.
- LauraBrunningCommunity Member
Hi,
I appreciate this was a while ago, but wondered if anyone can help.
I can get the variables to pass to the google spreadsheet, but I too am seeing the pop up error/message from website. Although it does let you close this message and carry on with the course (and the variables go onto the spreadsheet) - I'm struggling to get rid of it.
Can any one help??
Cheers, Laura
PS - Exported as SCORM running in VLE where the users have to use IE 11 (created in SL1)
PPS - should also have said that just using the scripts nicked from these forums without alterations except to add my spreadsheet/form and variable details (thank you!).
SCRIPT used in Google:
function myFunction() {
var SCRIPT_PROP = PropertiesService.getScriptProperties();
function doGet(e){
return handleResponse(e);
}
function doPost(e){
return handleResponse(e);
}
function handleResponse(e) {
var lock = LockService.getPublicLock();
lock.waitLock(30000);
try {
var doc = SpreadsheetApp.openById(SCRIPT_PROP.getProperty("1EMJiuiqZ7R8tX9MbeSrjrKEjgGfhw16LfLAYQ1_bOaY"));
var sheet = doc.getSheetByName(SHEET_NAME);
var headRow = e.parameter.header_row || 1;
var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
var nextRow = sheet.getLastRow()+1; // get next row
var row = [];
for (i in headers){
if (headers[i] == "Timestamp"){ // special case if you include a 'Timestamp' column
row.push(new Date());
} else { // else use header name to get data
row.push(e.parameter[headers[i]]);
}
}
sheet.getRange(nextRow, 1, 1, row.length).setValues([row]);
return ContentService
.createTextOutput(JSON.stringify({"result":"success", "row": nextRow}))
.setMimeType(ContentService.MimeType.JSON);
} catch(e){
return ContentService
.createTextOutput(JSON.stringify({"result":"error", "error": e}))
.setMimeType(ContentService.MimeType.JSON);
} finally {
lock.releaseLock();
}
}
function setup() {
var doc = SpreadsheetApp.getActiveSpreadsheet();
SCRIPT_PROP.setProperty("1EMJiuiqZ7R8tX9MbeSrjrKEjgGfhw16LfLAYQ1_bOaY", doc.getId());
} }SCRIPT USED IN STORYLINE
var player = GetPlayer();
$.ajax({
url: "https://docs.google.com/forms/d/1SzbvgcnV93aqOfHU4ycIlrJhD2BH4PpanB039l7Wgao/formResponse",
type: "POST",
data: {"entry.174521765" :player.GetVar("name"), "entry.1135805308":player.GetVar("id"), "entry.1806056227" :player.GetVar("colour")},
success: function(data)
{
alert(data);
}
});
return false;
THING ADDED TO STORY.HTML <HEAD>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
It works, the variable data gets filled into the Google sheet, it just brings up the error message attached - the user can close the error message and carry on as normal, it's just not a great user experience.
Thanks in advance!
- LauraBrunningCommunity Member
Strangely (to me) it appears to be something to do with the size of the browser's window, as I have just tried it with IE resized to half my screen - and it didn't display the error. Will try and figure it out, but hopefully someone will come and answer who knows how to sort it.
Thanks
- TracyParishSuper Hero
I have been struggling with this all day. Wow. Thanks folks for all the files, sharing, collaboration, examples, helping, etc. It made a big difference, but I missed one step somewhere along the line and finally figured out what was wrong.
Here is my 2 cents, for what it's worth now, on why mine didn't work. Maybe it will help the next person along this path.
I had my folder where the Google Form and Google Spreadsheet set open to Public, but the form/spreadsheet themselves were not. Without ensuring their share properties are public access as well, the variables from the course won't get written into the spreadsheet.
Thanks Tracy for the update and sharing that information here.
Related Content
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago