5 Replies
Todd Haynes

Here's a script that worked for me (last tested 2018).

//get player and variable
var player = GetPlayer();
var score= player.GetVar("Score01")
//get LMS API
var lmsAPI = parent;
//set score; the first number is the score
lmsAPI.SetScore(Score01, 100, 0);
//set status; possible values: "completed","incomplete", "failed", "passed"
if(Score01>80)
SetStatus("completed")
Vijay Paturkar

Below script works perfectly:

Here, I am translating the points accumulated in the user variable "TotalScore". Below JavaScript is inserted in the "Results" slide in Articulate Storyline. Remove the default Submit results trigger, and then insert below JavaScript.

--------------------------------------------------------------

var myscore = 0;
var player = GetPlayer();
var ptScore = player.GetVar("TotalScore");
var maxPoints = 330;
myscore = 100*ptScore/maxPoints;

SCORM2004_SetScore(myscore, 100, 10);
SCORM2004_CommitData();

--------------------------------------------------------------