Forum Discussion
SteveFlowers
Community Member
The JS is pretty straightforward. We've been using similar to the below for awhile. HTML5 references the lmsAPI differently than the Flash output. A conditional check to see if a function exists typically helps send the calls in the right direction.
var player=GetPlayer();
//status is pretty simple.
SetStatus("completed");
//if you also want to set the score.
lmsAPI=parent;
var tPercent=player.GetVar("SLSCORE"); //grab a score variable from storyline
if(lmsAPI.hasOwnProperty("SetScore")){
lmsAPI.SetScore(tPercent,100,0);
}else{
SetScore(tPercent,100,0);
}
Will_Findlay
7 years agoCommunity Member
Thanks Steve! Do you have the version of the code that accounts for HTML5 vs. Flash that you could share? :-)