• flickr
  • linkedin
  • twitter
  • rss
Set a SCORM completion in Storyline using javascript

Set a SCORM completion in Storyline using javascript

Run this as a ‘run JavaScript’ in Storyline and you’re done-burgers.

Storyline 360 (20.03.2018)

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);

//set score; the first number is the score
lmsAPI.SetScore(100, 100, 0);
//set status; possible values: "completed","incomplete", "failed", "passed"
lmsAPI.SetReachedEnd();
lmsAPI.SetPassed();

 

Old version – for SL2 and earlier:

//get LMS API
var lmsAPI = parent;
//set score; the first number is the score
lmsAPI.SetScore(100, 100, 0);
//set status; possible values: "completed","incomplete", "failed", "passed"
SetStatus("completed")
Tech Reference: , ,

Larry's a 30-something chap interested in travel, being a dork and changing the world via less boring training.

Leave a reply