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: , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑