Forum Discussion
lmsAPI Functionality in HTML5 Output
Hi Amit,
I would try replacing all instances of SetStatus("passed");
or SetStatus("failed");
with one of the following:
lmsAPI.SetPassed();
or
lmsAPI.SetFailed();
This should call the correct function directly.
Hi Adam,
I used a combination of your suggested codes:
var player = GetPlayer();
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);
lmsAPI.SetScore(player.GetVar("Results_ScorePoints"), 27, 0);
var passingScore = "23";
if (player.GetVar("Results_ScorePoints") >= passingScore)
{
lmsAPI.SetPassed();
} else {
lmsAPI.SetFailed();
}
Our LMS (Workday) reads this perfectly if the learner has passed the quiz which is set at 23 points (85%). The completion status is reflecting as Completed and the lesson grade as Pass.
On the other hand, if the learner gets below 23 points, the lesson grade is properly reflecting as Fail but the completion status is showing up as In Progress.
If I add this code:
lmsAPI.SCORM_CallLMSSetValue("cmi.core.lesson_status", "completed");
the completion status is properly showing as Completed, but the lesson grade does not reflect the Fail status.
The LMS Reporting is set to Completed/Failed, and the output option is SCORM 1.2.
Thank you so much!
Anne