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
- KevinThornSuper Hero
Sending data from Storyline using variables to a Google spreadsheet can be done...and quite effectively, too. I just finished a project doing this very thing.
First is setting up a Google Script. In Storyline you'll need to write a Javascript that will read all the variables and fire the data off. In our project we had over 50 questions each with 3 possible choices. We wanted to see the result (choice1, choice2, or chioce3) for each of the questions.
The neat thing is the Google Spreadsheet would update dynamically. We tested several outputs including a stand alone Storyline output on a web server, Storyline published as SCORM on an LMS, Storyline published for AO, and Storyline as a web object in a Studio '09 output in both SCORM and AO. Same project all sending data to the same spreadsheet while multiple users were accessing the various platforms and being able to literally watch the spreadsheet as it fills up.
- andreaestangaCommunity Member
Hello Kevin
Thanks for your post. I was able to send the variables to the Google spreadsheet. However, it only works when I use Internet Explorer. Also, I need it to work on an Ipad. At the moment it doesn't work on mobile devices. Did you tested on an ipad?
- ainemeehan1Community Member
no i haven't tested it on an iPad, but it does work in Google Chrome for
me.
- JohnSeafordCommunity Member
Hi,
I'm trying to do the same thing - EXACTLY! Do you have the scripts? Would be really appreciated. Cheers.
Anthony - AliHusainSorathCommunity Member
Please can you share the demo? and the java script code that will read all the variables and fire the data off. I want to store the result (choice1, choice2, or chioce3) for each of the questions.. exactly what you made, So it'll be of a great help!
- AndrzejRudnikPartner
- andreaestangaCommunity Member
Hello,
Thanks for your post. I was able to send the variables to the Google spreadsheet. However, it only works when I use Internet Explorer. Also, I need it to work on an Ipad. At the moment it doesn't work on mobile devices. Did you tested on an ipad?
- EdwardYankwittCommunity Member
this is exactly what I need, however, the answer is so old, some of the links don't work.
I am not a programmer and will need step by step on this issue.
Thanks for your assistance!
- AndrzejRudnikPartner
oh noo :(
I'm really sorry that I did not respond earlier but I had no access to the Internet - long duration holidays.
I don't know if I can do it but I have saved this page for all of you to pdf. There is note who is author of this article.
Function in Storyline can look like this (you can put it on Click event or timline starts):
var player = GetPlayer();
$.ajax({
url: "https://docs.google.com/forms/d/XXXXXXXXXXXXXXXXXXX/formResponse",
type: "POST",
data: {"entry.yyyyy" :player.GetVar("your_verible1"), "entry.zzzzz":player.GetVar("your_verible2")},
success: function(data)
{
alert(data);
}
});
return false;
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)
your_verible1, your_verible1 - veribles from Storyline
If you want to check how it is work you have to put content on server.
- MichaelHinzeCommunity Member
Here is my take on using GoogleDocs with Storyline variables: http://dev.keypointlearn.com/xcl71_SL/Soccer/story.html
- Marie-Pierre930Community Member
This is really helpful. But can you describe the first steps?
-Getting a googledocs account?
-Creating a link?
-Then putting in the javascript into storyline to point to googledocs?
These kind of steps would really be helpful. I am fearly new at this and I am not a programmer,
thanks
- TracyParishSuper Hero
Hi Marie:
I got this working now and was confused with the first steps as well. Feel free to contact me directly through the forum and I'll be happy to walk through it with you.
- 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!
- YoniHCommunity Member
Brilliant solution and thanks for sharing Andrzej.Unfortunetly the second link is not working for me. Could you please try repost it?
I am desperately trying to accomplish the same solution whcih you have.
Thanks
- JedidiahEspositCommunity Member
Howdy,
Sorry for my slow response here.Someone asked for clarification on my post above. This script is actually making use of the jQuery library, so in order for it to work properly you've got to add a link to the library to your html file.
So you'll want to add the line of code (below) to the "story.html" and "story_html5.html" files after publishing the module for web. This line of code should be added immediately after the <head> tag in both files. It allows them to find and access the jQuery library which contains the instructions needed for the Javascript code to use Ajax to manipulate the Google Spreadsheet.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
Note: You may need to alter the 1.9.1 portion of this link to the latest version depending upon when you're seeing this message.
I hope that helps. I'm happy to take a look at projects that aren't working properly to see if I can suss it out.
Kind regards,
Jedidiah - BenClarkCommunity Member
Dorothy,
Did you ever get a solution to this? It would be great to see the solution listed on this page. Several colleagues and I are all trying to do what you described.
Thanks!
Ben
- PatrickGeigerCommunity Member
Quick note to anyone else who attempts to implement his solution. The outputted HTML file (story.html) does not include the jQuery library (Andrzej's solution requires it). As a result, you must manually include it in the head of your outputted HTML file (e.g. "").
Thanks Andrzej!
Patrick
Thanks Michael for sharing that here.