lmsAPI.SetScore is not working



I have a course where I want to get a custom score. For example, I want every user to get a score of 87%, so the LMS has the information "87%". 


First, I tried this code: ("scoreCustom" is my variable in Storyline, with a value of 87)

var player=GetPlayer();
var totalScore=player.GetVar("scoreCustom");


But this doesn't work on HTML5 devices, only in Flash. So I tried another code, for HTML5: 


var player=GetPlayer();
var totalScore=player.GetVar("scoreCustom");
var lmsAPI = parent;
lmsAPI.SetScore(totalScore, 100, 0);


But this doesn't work either. 

Any suggestions? 

2 Replies
Daniel Koch

Found a solution in another post: 




var player = GetPlayer();
var passingScore = "100";
function findLMSAPI(win) {
if (win.hasOwnProperty("GetStudentID")) return win;
else if (win.parent == win) return null;
else return findLMSAPI(win.parent);

var lmsAPI = findLMSAPI(this);
lmsAPI.SetScore(player.GetVar("Your_Score_Variable"), 100, 0);
if (player.GetVar("Your_Score_Variable")>= passingScore)
} else {