Forum Discussion

NandiniNK's avatar
NandiniNK
Community Member
13 years ago

Help with javascript - Passing score to LMS

HI

I have developed a course having 2 quiz and a result slide. One of the quiz is not developed with the built in storyline quiz template, so I cannot link it up to the result slide. So I have added a new slide wherein I am displaying the score. I want to pass this score to LMS based on which LMS will decide whether pass or fail.

Attached is the .story file. The total score is calculated in the 'hazards' variable. This variable is also used in my Result slide to show whether pass/fail. On the result slide, I have added this javascript to pass the score to LMS and mark pass/fail in LMS accordingly. This code is not working in ScormCloud. Please tell me if anything is wrong with the code.

Code:

var player = GetPlayer();
var lmsAPI = parent;


lmsAPI.SetScore(player.GetVar(“hazards”), 70, 0);


if(player.GetVar(“hazards”)>=60)
SetStatus = "Passed";


if(player.GetVar(“hazards”)<60)
SetStatus = "Failed";

11 Replies