I Want to Send the Value of a Project Variable to an LMS as the Score

Oct 15, 2021

The title says it all, really. I'm not using any built-in quiz functionality because I'm using a custom scoring scheme where there is no one right or wrong answer. This is for a branching scenario.

I have a project variable capturing the cumulative score. It's the value of this variable that I want to pass to the LMS (Brightspace) as the official score. Publishing as SCORM 2004 4th edition.

Is this possible?

Many thanks.

10 Replies
Joseph Francis

You sure can. First, set up communication with the Storyline Player by retrieving its handle.

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);

SetScore() requires 3 arguments to work: the learner's score, the maximum score, and the minimum score. Before we can send it, we need to retrieve the learner's score (contained in a variable you created) from the course.

var lmsScore = player.GetVar("learnerScore");

Now we can send that back to the LMS.

lmsAPI.SetScore(lmsScore, 100, 0);

If you also want to tell the LMS if the learner has passed or not, you can send the course status at the same time, based on the score. For example, if the passing score is 80:

if (lmsScore >= 80) {
     SetStatus("passed");
     } else {
     SetStatus("failed");
}

Dan Epstein

Joseph-

I realized I have one more question before I try this. In the argument:

lmsAPI.SetScore(lmsScore, 100, 0);

is the 100 and 0 setting the score range in points? If so, should I replace 100 with the max value my project scorekeeping variable can attain (6) and 0 with the lowest value (-3)?

Joseph Francis

That could be a problem, as per the SCORM specification, both cmi.core.score.max and cim.core.score.min (what a SCO and the LMS use to set minimum and maximum scores) have to be "normalized values between 0 and 100."

Sharable Content Object Reference Model (SCORMĀ®)

Scroll down to SCORM 1.2 > Technical Specification (Version 1.2) (zip file) for details.

 

Joseph Francis

I know with an LMS like SumTotal, I essentially "turned over" course completion to the LMS, where it handled the marking of either "Passed" or "Incomplete," based on the score returned by the course.

In your case, which executed first, the SL trigger or the Javascript? Order of execution does make a difference. Try it with the SL trigger disabled.

Dan Epstein

I had the JS trigger fire first. I took your advice and disabled the course completion trigger but no score was passed to SCORM Cloud. 

I really appreciate your help. Passing the score to the LMS is, at this point, a nice-to-have. I have each scenario set up so the learners see a summary page based on their score, and those pages have the appropriate pass/fail SL trigger built in. 

I really would like Articulate to move beyond just right and wrong answer capability, and to  allow the built-in variable that captures scores on a quiz to be exposed to triggers. 

Again, many thanks.