Does anyone know of the javascript needed to send scores from a test to the LMS? I have seen many articles but can't find the answer. I need to pass the score and completion status. Thank you.
I typed "storyline google sheets answer recording" into my search engine and found some great starting points back in these forums including this post and a second post.
Here's a script that worked for me (last tested 2018).
//get player and variable
var player = GetPlayer(); var score= player.GetVar("Score01")
//get LMS API var lmsAPI = parent; //set score; the first number is the score lmsAPI.SetScore(Score01, 100, 0); //set status; possible values: "completed","incomplete", "failed", "passed" if(Score01>80) SetStatus("completed")
Thank you so much for your reply. I have been down a rabbit hole. I gave that a shot but no luck after testing in Scorm cloud. I'm sure I'm doing something wrong. Can you look at my test file?
Here, I am translating the points accumulated in the user variable "TotalScore". Below JavaScript is inserted in the "Results" slide in Articulate Storyline. Remove the default Submit results trigger, and then insert below JavaScript.
5 Replies
I typed "storyline google sheets answer recording" into my search engine and found some great starting points back in these forums including this post and a second post.
Here's a script that worked for me (last tested 2018).
Thank you so much for your reply. I have been down a rabbit hole. I gave that a shot but no luck after testing in Scorm cloud. I'm sure I'm doing something wrong. Can you look at my test file?
Hey there :-) could someone explain to me how this works? Would be great, thank you! :-) best regards, Carina
Below script works perfectly:
Here, I am translating the points accumulated in the user variable "TotalScore". Below JavaScript is inserted in the "Results" slide in Articulate Storyline. Remove the default Submit results trigger, and then insert below JavaScript.
--------------------------------------------------------------
var myscore = 0;
var player = GetPlayer();
var ptScore = player.GetVar("TotalScore");
var maxPoints = 330;
myscore = 100*ptScore/maxPoints;
SCORM2004_SetScore(myscore, 100, 10);
SCORM2004_CommitData();
--------------------------------------------------------------
This discussion is closed. You can start a new discussion or contact Articulate Support.