Custom scoring in Storyline

Jan 17, 2024

We have created a piece of learning that use our own scoring (Varscore) rather than the built in quiz scoring . It's a try me test me scenario, the user gets 5 points for each slide if they click in the correct place, 0 points if they don't. When publishing to LMS it shows Pass or Fail correctly however we are struggling to get the final score to appear on the LMS. Changing the tracking option to slide views doesn't work as every user will view every slide.We are not Javascript fluent so if anyone has had experience of similar we would really appreciate some advice. 

1 Reply
Dave Ruckley

I've used the following javascript that triggers when the timeline starts on the last slide and it writes successfully back to the LMS:

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("final_user_score"), 100, 0);
SCORM_CallLMSSetValue("cmi.core.lesson_status", "complete");