Forum Discussion
LukeWestfall
9 months agoCommunity Member
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_
9 months agoCommunity Member
Hmm. I don’t think there’s an event driven way to determine when cmi.core.lesson_status is complete (or when any scorm value changes), so maybe there is something you could do with the first idea.
In storyline you’d craft a file that executes custom javascript on timeline load/end, then publish it and load the storyline file into rise where you want it to execute (like at the end perhaps).
It would find the scorm api and set the score fields directly (if you’re setting raw you have to also set min/max). This is off the top of my head, but something like this might work:
var findAPITries=0;function findAPI(win){while((win.API==null)&&(win.parent!=null)&&(win.parent!=win)){findAPITries+=1;if(findAPITries>7){alert("Error finding API -- too deeply nested.");return null}win=win.parent}return win.API}function getAPI(){var theAPI=findAPI(window);if((theAPI==null)&&(window.opener!=null)&&(typeof(window.opener)!="undefined")){theAPI=findAPI(window.opener)}if(theAPI==null){alert("Unable to find an API adapter")}return theAPI}
const lmsAPI = getAPI(this);
if (lmsAPI) {
lmsAPI.LMSSetValue('cmi.core.score.min’,’0’);
lmsAPI.LMSSetValue('cmi.core.score.max’,’100’);
lmsAPI.LMSSetValue('cmi.core.score.raw’,’80’); // set your score here, maybe pull from a storyline variable etc
lmsAPI.LMSCommit(‘’);
}