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
- AlfredGalang-12Community Member
Thanks Guys!
- TracyParishSuper Hero
I just posted, what I hope, is a step-by-step guide for making this work. I based it on the posts here and what I learned from them gathering them together. There were a few of us that needed steps from the beginning and others that needed them only part way through.
Hope this helps anyone new to this particular forum.
http://www.tracyparish.ca/2015/08/how-to-send-variables-from-storyline-to-google-docs.html
- KillianHolmesCommunity Member
Thanks for talking the time to figure this out, articulate it and share it. I'm not a coder, but I can follow instructions!
Thanks Tracy! Definitely a popular thread.
- MikeFCommunity Member
Mucho props for Tracy. She helped me get this up and running.
I wanted to add something here. Tracy mentioned that she is using IE8. So am I, but here is how I got it working. I added a dataType: "jsonp" to the script. It now works for me in IE8.
============================
var player = GetPlayer();
$.ajax({
url: "https://docs.google.com/forms/d/1ebGN0lrq2_DU24UtsQqpD9Zf64TZiPAFNDN9gu8MjlE/formResponse",
type: "POST",
dataType: "jsonp",
data: {"entry.340255159" :player.GetVar("FirstName"),- TracyParishSuper Hero
Thank Mike. I'll add that to my post.
- TracyParishSuper Hero
Brilliant! Mike, you just solved this issue for me.
This was a posting I found for why this works....I have no idea what he is talking about, I'm just glad it does what I need it to.
"It returns your JSON data wrapped in a function name. jQuery handles the function name behind the scenes and passes the data into your success handler. The data is loaded by dynamically creating a script element with the src attribute pointing to the service being called and then attached to the browser's DOM. Then the browser makes a request to the resource and the web service responds with the callback function and data."
Thanks Mike for sharing the additional bit of code here.
- ChristiePollickCommunity Member
Delighted to see that you found the help you needed, Killian! :)
Thanks for that update Tracy - this thread is a popular one, so I'm certain it'll help other folks.
- MikeFCommunity Member
No sweat, Tracy. Thanks for your help.
Read the posting 3 times. Still clear as mud. =)
- JaneJamesCommunity Member
Hi all -
First of all - thanks for the discussion! Like many others, I'm not a coder so it is inspiring to see how many people are working together to build a solution to this problem.
I've had a lot of help from Tracy - her tutorial is amazing! - but am still having trouble implementing a solution.... I'd really appreciate any advice that could be given for my 1 variable, test Articulate course...
Thanks again!
Jane James
Link to hosted articulate course
https://googledrive.com/host/0B82TWSb7pI3wQ2dkWlMyT2lBSGs
Link to survey form
- https://docs.google.com/forms/d/1c9OZMa1hFuM39FqwU7dz-1GzSXrcdbjCD59Ldnbcx4o/viewform?usp=send_form
Link to articulate course
https://drive.google.com/open?id=0B82TWSb7pI3wSkZTVEhpcTlLR2M
Text of the javascript program
var player = GetPlayer();
$.ajax({
url: “https://docs.google.com/forms/d/1c9OZMa1hFuM39FqwU7dz-1GzSXrcdbjCD59Ldnbcx4o/formResponse”,
type: “POST”,
dataType: “jsonp”,
data: {“entry.1796023489” :player.GetVar(“Hi“)},
success: function(data)
{
alert(data);
}
});
return false;
- JaneJamesCommunity Member
Figured it out... being a newbie, I didn't realize I was using the wrong quotation marks. After re-typing everything that was going into javascript and the story file, it works! (minus the jsonp... that's a problem for later)
Lessons learned
- try jsfiddle to see if your quotations and brackets are matching
- although I didn't use it (I'm on a hospital computer), notepad++ is apparently good for catching freaky Unicode that doesn't show up on notepad or on the input section of articulate
- if you are stuck, definitely try running CTRL-Shift-J on chrome to see what exact errors you are getting from javascript
- yodeling "never quit" is surprisingly effective (not recommended until desperate)
Related Content
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago