Forum Discussion
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 ...
Jürgen_Schoene_
2 years agoCommunity Member
try
var myScore = lmsAPI.GetScore();
https://community.articulate.com/discussions/articulate-storyline/using-lmsapi-getscore
here is a solution, if lmsAPI not found (if it's not parent)
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);