Setting SCORM status in Articulate Storyline 360

I've gone through several threads here on sending SCORM Status and Score to the LSM via JavaScript. Here's a nice write up.  There are other discussions as well. Overall, they all come down to this code:

var lmsAPI = parent;
lmsAPI.SetScore(100, 100, 0);
//set status; possible values: "completed","incomplete", "failed", "passed"
SetStatus("completed");

For some reason, the moment I try to use SetStatus, it throws an error. I'm not using SCORM 2004, so it should work. But for me in SL 360 in ScormCloud it just won't work. The score setting is fine.

For those who may run into this, this was my workaround: I have a JS variable, totalPerf, which is a number betwen 0 and 1, as percent of performance. I wanted to send the score as %, and the set the status as completed if it's larger or equal to 70, and incomplete if it's smaller. 

var lmsAPI = parent;
lmsAPI.SetScore(Math.round(totalPerf*100),100,0);

if (totalPerf>=0.7)
{

// Sends completed status.
lmsAPI.SetReachedEnd();
}
else
{

lmsAPI.ResetStatus();
}

This may or may not work in yours but it's worth a try.

4 Replies
James Reid

Thanks for this Zsolt.  I am very interested in any kind of additional reporting to ScormCloud via javascript and your notes in various places have been a great help to me. Although I understand it is not supported by Articulate, and liable to change, it is very useful. Anyone else with insights, please chime in? I am using SL3update2, publishing HTML5, SCORM2004 4thd ed, hosting in ScormCloud. I found changes since SL2: (1) lmsAPI=parent no longer works for me. lmsApi=[object Window] seems to work. (2) lmsAPI.SetStatus seems to not exist any more in this context? I will try your workaround, using SetCompleted, SetPassed and ResetStatus which seem to still exist. Question: you imply limitations with SCORM2004. Where can I find more info on this? What publish format are you using for ScormCloud? Thanks.

Bastiaan Timmer

Maybe this is also helpful. We created two Javascript scripts for sending the completion state to the LMS. We based our code on the SCORM2004functions.js and SCORMfunctions.js files:

SCORM 1.2:

//get LMS API
var lmsAPI = parent;
//set score; the first number is the score
lmsAPI.SetScore(90, 100, 0);
//set status; possible values: "completed","incomplete", "failed", "passed"
SCORM_CallLMSSetValue("cmi.core.lesson_status", "complete");

SCORM 2004:

//get LMS API
var lmsAPI = parent;
//set score; the first number is the score
lmsAPI.SetScore(90, 100, 0);
//set status; possible values: "completed","incomplete", "failed", "passed"
SCORM2004_CallSetValue("cmi.completion_status", "completed");
SCORM2004_CallSetValue("cmi.success_status", "passed");

I've tested both script on SCORM Cloud and they are working as expected.