Forum Discussion
Send module progress to LMS (Cornerstone)
Hi Claire,
I would push on with cmi.objectives as it looks to be well supported in cornerstone.
cmi.objectives aren't widely used, and so you could expect some problems implementing, but I think it is worth a go before going down the multi sco route.
You will be able to use Storylines reference to the SCORM 1.2 API if the module is published as SCORM 1.2.
There are a couple of issues with the script you have as an example. For example, cmi.objectives are kind of an array, and so start at zero. When you see a reference to a cmi.objective like this, "cmi.objective.n.status", n = the index of the objectives. This value cannot be anything other than a number, and must be sequential. For example, you can't skip numbers. The object ID is use to try and give your objective some kind of meaningful ID for ID in the LMS. It can only be alphanumerical though (hyphen, dash or underscore are legal).
So, when you initialize your objectives, you would want to do something like this:
initObjectives = function()
{
var goals = 36;
for (var i = 0; i < goals; i++) {
// using the Storyline function SCORM_CallLMSSetValue
// which takes care of error handling and getting the API
var objid = "objective_"+i;
var success = SCORM_CallLMSSetValue("cmi.objectives." + i + ".id", objid);
if(success)
{
success = SCORM_CallLMSSetValue("cmi.objectives." + i + ".status", "not attempted");
if(!success) alert('Unable to set the status for the objective cmi.objectives.' + i + '.id');
}else{
alert('Unable to set the ID for the objective cmi.objectives.' + i + '.id');
}
}
}
// if the total amount of objectives set is 0 (zero), then initialize them
// this check ensures that the objectives are only initialized once!
if(SCORM_CallLMSSetValue("cmi.objectives._count") === 0) initObjectives();
// user starts the objective
SCORM_CallLMSSetValue("cmi.objectives.0.status", "incompleted");
// user completes the objective ("passed", "completed", "failed");
SCORM_CallLMSSetValue("cmi.objectives.0.status", "completed");