Reputation: 84
What javascript API calls are needed to set the grade after completing an activity? Now I have these three calls:
LMSSetValue("cmi.core.score.min", 0);
LMSSetValue("cmi.core.score.max", 100);
LMSSetValue("cmi.core.score.raw", score);
I also set the status to completed:
LMSSetValue("cmi.core.lesson_status", "completed");
When I complete the activity as a student, sometimes I can see icon which tells that activity is completed ("1 attempt(s)"), sometimes not. The gained score is never there.
Desire2Learn is at version 10.1
Upvotes: 1
Views: 3858
Reputation: 4581
As Viktor says, you must invoked LMSCommit
after using LMSSetValue
, or else the data will not be persisted ('saved') in the LMS.
LMSSetValue("cmi.core.score.min", 0);
LMSSetValue("cmi.core.score.max", 100);
LMSSetValue("cmi.core.score.raw", score);
LMSSetValue("cmi.core.lesson_status", "completed");
LMSCommit(); //save in database
LMSFinish(); //exit course
Note that "LMSSetValue
" is not an official SCORM call, it means you're working with a SCORM wrapper of some kind. Therefore where I say LMSCommit
and LMSFinish
, you might actually need to use different syntax -- I'm just guessing about the function names. Check your SCORM wrapper's documentation. The point is that you need to commit (save) and terminate (finish).
Upvotes: 0
Reputation: 3418
Not a SCORM expert by any means, but someone here that knows more about it than me makes these points:
You also need to call Commit
and Terminate
and/or LMSFinish
; you can find some good technical resources to help developers at the SCORM website, in case you don't already know about them.
To verify scores and status getting to the Learning Environment, you can check the SCORM reports in the Web UI (Content > Table of Contents > View Report), which is the standard place to view SCORM results.
If scores are set there, you can get them into the grade book in two ways:
You can preview the content topic as an instructor: below the topic view, you'll find a spot to associate a grade item with the topic.
If the DOME configuration variable d2l.Tools.Content.AllowAutoSCORMGradeItem
is on for the course, that should automatically create a grade item for that SCORM content object.
Upvotes: 1