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
- VuHoangCommunity Member
Ben T said:
Hmmmm still having no luck. I have used this exact syntax (below), and replaced the google link, column numbers, and variable names to match my module. No error message appears, but no results post to the google doc either.
The connectivity and form are functioning, as I directly embedded the form into the same module on a different slide and that generates results.
Any ideas? Any help would be greatly appreciated.
var player = GetPlayer();
$.ajax({
url: "https://docs.google.com/forms/d/1AdbAVu3_ER3cL7o6LcDaMSRUfT5Loo6Hlpvc6TuatLc/formResponse",
type: "POST",
data: {"entry.495789985" :player.GetVar("Name"), "entry.647210599":player.GetVar("Event")},
success: function(data)
{
alert(data);
}
});
return false;
Can you show me your project ? - 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 - VassilikiBoukiCommunity Member
It works! Thank you all. My warmest and sincerest thanks especially to Jason and to Jedidiah. Great help!
- ainemeehan1Community Member
I feel so stupid re this. Would someone be kind enough to check my code. This is literally all I have in the execute javascript area. I have two text input boxes for a name and student id. The trigger is that when the next button is clicked the javascript is executed. I have tested the entry.37118808 numbers in a web page and it works. I also have the jquery part in the story.html file. I'm just missing something obvious. I think I will be learning javascript :)
I would really appreciate any help,
p.s. I more or less copied Jedidiah's code, so thanks for that Jedidiah.
thanks,
aine
var player = GetPlayer();
$.ajax({
url: "https://docs.google.com/forms/d/1MjBkCNiANT18g9X-CyXoCoP58KkynJusV47ETBNwAp4/formResponse",
type: "POST",
data: {"entry.239328797" :player.GetVar("StudentName100"), "entry.37118808":player.GetVar("IDNumber100")},
success: function(data)
{
alert(data);
}
}); - ainemeehan1Community Member
uploaded whole thing to Google drive, and it worked. only change I made was the version of jquery I linked to.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
stupidly I had http://ajaz.........
so it was probably a security issue or something.
- JasonNCommunity Member
Hi All -
I've been toying around with this for the past couple days, and I'm pretty close but I think I need some assistance.
I have two variables at the beginning of the session for the first name and last name, as well as a variable for the quiz results which was created when I made the quiz results slide.
the name variable are able to post to google docs with no issue, however I can't get the quiz results to post. I have confirmed it's not an issue with the google docs data element, as tested with creating a variable to manually enter a number and that posted successfully.
Has anyone seen this where the default variables don't post as expected?
the Javascript I have is:
var player = GetPlayer();
$.ajax({
url: "https://docs.google.com/forms/d/1X8rIvOE9F3cSyCGXpvFwUzug_oUNkz6q1kiUZQJ7f5o/formResponse",
type: "POST",
data: {"entry.1159969422" :player.GetVar("FirstName"), "entry.1107543477":player.GetVar("LastName"), "entry.1692446738":player.GetVar("Results.ScorePoints")},
success: function(data)
{
alert(data);
}
});
return false; - MichaelHinzeCommunity Member
If I remember correctly, you need to store the value of Results.ScorePoints in a custom variable, e.g. MyScore and then pass this variable into your JavaScript.
- JasonNCommunity Member
Thanks for the quick response... I'm going to give this a shot..
- JasonNCommunity Member
I'm fairly new to storyline and I've played around with this suggestion,
but I'm not sure how to store the value of one variable
(Results.ScorePoints) to another custom built Variable....
I'm only familar with how to have a user manually enter a value for a
variable.- MichaelHinzeCommunity Member
You could use a trigger like tis:
- andreaestangaCommunity Member
Thank you Aine!. Did you add something else to make it work on Google Chrome?
If anybody is able to make it work on an iPad please let me know.
- ainemeehan1Community Member
no, but i can send you my code. i will be testing it on ipad1 next week if
thats any good to you, or you could test my wonky test version yourself,
and put in your real name as student name, and i will check the google
form, then you will know if your name appears that the code works on ipad, and you can then copy my
code.
here is link;
http://library.itsligo.ie/screens/ilo/ilo
- andreaestangaCommunity Member
thanks!, but please check that link you sent me because is not working, not even on PC
- ainemeehan1Community Member
Sorry, try: http://library.itsligo.ie/screens/ilo/ilo
- andreaestanga-4Community Member
Aine,
I still get the same message when I try to open your link:
404 Not Found
The requested URL was not found on this server.
- ainemeehan1Community Member
it was only putting in part of the url. Its not working for me now, in either ie or chrome, because I uploaded a new version today. im tearing my hair out. http://library.itsligo.ie/screens/ilo/ilo_output/story.html
- andreaestangaCommunity Member
uhh :(. Let me know if works for you again
Related Content
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago