There are 2 objects available in JavaScript that only work in the SCORM HTML5 export. lmsAPI and lmsAPI.objLMS
If you type the following into the JavaScript Trigger you will get a list og methods available for the objects printed into the browser console. (If you are not familiar with the console you can Google "how to access the browser console" and it will show you how to use it) console.log(lmsAPI) console.log(lmsAPI.objLMS)
As an example: You can set a scorm objective score using: lmsAPI.objLMS.SetObjectiveScore('policy_quiz', score_variable, '100', '0');
You can set the status of a SCO using: lmsAPI.SetStatus('completed');
You can set data from suspend_data using var player = GetPlayer(); var score1 = parseInt(player.SetVar("my_variable","my_value"));
You can get data from suspend_data using var player = GetPlayer(); var score1 = parseInt(player.GetVar("my_variable"));
Is there also a way that we could track/retrieve the scores of the LMS in different sessions? like we can compare what's the highest score we've got when taking the quiz? Thanks for your help.
Hi Franceley! This would be handled by your LMS or perhaps JavaScript, neither of which I will be able to assist you with. Hopefully someone in the community will be able to chime in and assist.
3 Replies
There are 2 objects available in JavaScript that only work in the SCORM HTML5 export.
lmsAPI and lmsAPI.objLMS
If you type the following into the JavaScript Trigger you will get a list og methods available for the objects printed into the browser console. (If you are not familiar with the console you can Google "how to access the browser console" and it will show you how to use it)
console.log(lmsAPI)
console.log(lmsAPI.objLMS)
As an example:
You can set a scorm objective score using:
lmsAPI.objLMS.SetObjectiveScore('policy_quiz', score_variable, '100', '0');
You can set the status of a SCO using:
lmsAPI.SetStatus('completed');
You can set data from suspend_data using
var player = GetPlayer();
var score1 = parseInt(player.SetVar("my_variable","my_value"));
You can get data from suspend_data using
var player = GetPlayer();
var score1 = parseInt(player.GetVar("my_variable"));
Is there also a way that we could track/retrieve the scores of the LMS in different sessions? like we can compare what's the highest score we've got when taking the quiz? Thanks for your help.
Hi Franceley! This would be handled by your LMS or perhaps JavaScript, neither of which I will be able to assist you with. Hopefully someone in the community will be able to chime in and assist.
This discussion is closed. You can start a new discussion or contact Articulate Support.