CameronHallo868
2 years agoCommunity Member
GetScore from Moodle
I am trying to have when students retry an activity they have their current best score displayed as an incentive.
I am struggling to get the GetScore(); value to return the previous highest score attempt from Moodle. The console shows a blank result and the storyline variable keeps coming back blank when I set as text or NaN when I set as a number.
I have tried varaiations of the following without success, (yes there is a score recorded on the LMS to access).
var lmsAPI = parent;
var player = GetPlayer();
var myScore = GetScore();
console.log("test "+myScore);
player.SetVar("pastscore", myScore);
Does anyone have a simple working version they can share so I can learn from?