Forum Discussion

LukeWestfall's avatar
LukeWestfall
Community Member
11 months ago

SCORM/xAPI not passing grade to Brightspace (D2L) gradebook

Hello, D2L's gradebook only pulls the cmi.core.score.raw value from SCORM objects, but Rise only passes that value via quiz objects. In Moodle 3, we can set pass completion status as a score to it...
  • Tim_'s avatar
    Tim_
    11 months ago

    Hi

    In my attached course, I’ve tried to set the score using the code from above inside a storyline object. This worked for my own scorm test harness, but not in scorm cloud. Not sure why.

    I then tried changing tack. I modified the ./scormdriver/scormdriver.js file to emit an event when SetValue is called so that it’s easier to add custom logic. I then added a script block right before the closing </body> tag to the ./scormdriver/indexAPI.html file that detects the lesson_completed state and also sets a score. 

    <script>
    /* custom event handler for SCORM_CallLMSSetValue */
    window.addEventListener('lmssetvalue', function(e) {
    const {api,key,value} = e.detail;
    switch (key) {
    case "cmi.core.lesson_status":
    if (value == "completed" || value == "passed") {
    console.info('heard lesson_status completed or passed, setting score');
    // set the score to 100
    api.LMSSetValue("cmi.core.score.raw", "100");
    api.LMSSetValue("cmi.core.score.min", "0");
    api.LMSSetValue("cmi.core.score.max", "100");
    console.info(api.LMSCommit(""));
    }
    break;
    }
    });
    </script>

    On scorm cloud, the score is set to 100% when the course completes.

    Does this help?