Forum Discussion
Articulate Storyline: Export to Google Drive
I already tried but still doesnt work out, please anybody could tell me where did I go wrong.
I set trigger (execute javascript) when time line start at my final/last slide
others JS work fine at the same slide: $(".volume").hide(); & others 2 JS
here is my code for Export to Google spreadsheet:
first JS when time line start:
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.src = '//code.jquery.com/jquery-1.11.0.min.js';
script.type = 'text/javascript';
head.appendChild(script)
Second JS when time line start:
var player = GetPlayer();
//PLACE YOUR WEB APP URL
WEB_APP_URL = "https://script.google.com/macros/s/AKfycbwz8K0yH2XFKK44vPg5ncTQT8FztUivgAM-0DzvK85G7T1vaLc/exec";
// STORE ARTICULATE STORYLINE VARIABLES
// "Columnname_Google_Spreadsheet" : player.GetVar("Name_Storyline_Variable")
// ATTENTION: Use a comma if you use multiple Storyline variables
storyline =
{
"date" : new Date().toJSON().slice(0,10), //STORE DATE
"Tanggal" : player.GetVar("Tanggal"),
"Nama" : player.GetVar("Nama")
}
Third JS when time line start:
//DELAY SO JQUERY LIBRARY IS LOADEDsetTimeout(function (){
//Export to Google
$.ajax({
url: WEB_APP_URL,
type: "POST",
data : storyline,
success: function(data)
{
console.log(data);
},
error: function(err) {
console.log('Error:', err);
}
});
return false;
},
1000);
and here is a Link to my Course:
any though will be appreciate. Thank You
Hi Anderson Rumuy thank you for sharing. I want to do a small modification.
--------------------------------------------------------------------------------------------
There is a line like below in "first JS when time line start:" section.
script.src = '//code.jquery.com/jquery-1.11.0.min.js';
The edited line like below.
script.src = 'http://code.jquery.com/jquery-1.11.0.min.js';
--------------------------------------------------------------------------------------------
I just added "http:" in the above line. Please give me your valuable replay on this.
- KengHweeWee5 years agoCommunity Member
I follow your suggestion and it works. Thanks