Forum Discussion
exporting variables to be read in a Google docs spreadsheet
Hi All -
I'm not sure how many people monitor this post anymore, but I thought I would give it a shot.
I had this working a few years ago, and unfortunatly I had my hard drive fail and lost my source files that worked. Now I'm trying to recreate the ability to post to a google form with not a lot of success.
I have created a test training:http://nagelsconsulting.com/Lockout/story.html
The idea is to have the firstname, lastname and score output to the google form.
I can see now that after completing the course the timestamp is entered, but none of the values are passing to the google form. Here is my spreadsheet results:
https://docs.google.com/spreadsheets/d/1MTo41Vb8Vkfd6jaCPRzkdGg0LSHLUxk7GtRvBBrhvso/edit#gid=361735704
The javascript I have entered is as follows:
var player = GetPlayer();
$.ajax({
url: "https://docs.google.com/forms/d/1eshntCAnj-xod2Ql-R2VBUx0lnMCQ-wrd_y9DfaMZok/formResponse",
type: "POST",
dataType: "jsonp",
data: {"entry.1307427408":player.GetVar("FirstName"), "entry.1400570972":player.GetVar("LastName"), "entry.1439160339":player.GetVar("Score")},
success: function (data) {
alert(data);
}
});
return false;
----
I have also made sure to edit the published story.html with the following code:
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
any help that can be provided would be very much appreciated!
just in case anyone wants to take a look at the source file, I have attached the storyline test file.