Communication with LMS - updating score

Jul 21, 2016


Here's part of my javascript, that sends quiz score to the LMS (in my case - moodle): 

lmsAPI.SetScore(player.GetVar("FinalResultPercent"), 100, 0);

So im entering quiz in Moodle, trying to solve it and get, let's say, 60% points. 
Now, I want to have an next attempt. Moodle (and my course) asking me, if I want to resume where I have left. I click ok, I do the quiz one more time, and got 90% (inside the quiz every reset result etc. works fine, because I got in the final screen the new score). And there is the problem - in Moodle in Gradebook I still see old grade. It looks like Moodle doesn't allow course javascript update the score. 

Has anyone came upon the same problem? How it can be solved? Is it Moodle or storyline output problem?

I can add, that when I check in Moodle "Start a new attempt" the new score get registered, but in anther attempt (so now I have two attempts with two different scores) - but you know, I can't assume that every user entering the quiz will check that box. 


6 Replies
Mateusz Szuter

Thank you Phil for your reply, my course indeed goes into review mode!
In my course I have following piece of javascript passed to Moodle:

if (player.GetVar("FinalResultPercent")>= player.GetVar("PassingPercentage"))
{ SetStatus("passed"); }
{ SetStatus("failed"); }

And my relevant Moodle options for SCORM Activity are following:

  1. Grade
    1. Grading method: Highest Grade
    2. Maximum grade: 100
  2. Attempts Managment
    1. Number of attempts: Unlimited
    2. Attempts grading: Highest attempt
    3. Force new attempt: No - I can basically set it to yes and it will solve the problem, but don't know if user can restart course from where he left nor does my client would have this option enabled.
  3. Comaptibility Settings
    1. Everything set to No
  4. Activity Completion
    1. Require grade: 80
    2. require status: Passed

Tried to mess around with compability settings but neither of them gives me fine results. 

Strangely, when showing TOCC, I have green tick after submitting the whole Quiz. And according to my JS, passed status should be set only after getting the 80 in quiz. :(

Mateusz Szuter

Well now I'm a little bit confused!

I've dropped IF statement and simply on failed layer put code SetStatus incomplete, and on passed layer setstatus passed.

Now the fun part - I pass the test, I can see the green tick in TOCC, I can see my grade in grade book. And then I click button with trigger Exit Course and... course grade reset to 0 and status to incomplete.

When I don't pass - grade isn't stored in moodle (earlier it was), status is not changed, but when I click exit, I have grade 0 for the attempt and status failed, and when I resume - I'm in review mode.

Inside the tracking options in storyline I have tracking: slides viewed (40 of 40), and report to lms as "Passed/incomplete".

Phil Mayor

Can they achieve 40/40? If they can when you close the course at that point Storyline will overwrite whatever you send to the LMS if you add this to slide master it will ensure Storyline does not overwrite you course

ReportStatus=function(){ //since we don't want Storyline to overwrite our scoring... let's overwrite that $#it. }
Mateusz Szuter

Phil thank you for your help,

I've just got tired of it sadly. :)

editing lms/lms.js in package, at lines:

75 case "BW_ClosePlayer":
76 // This is an important milestone, save the data
78 //ReportStatus();

I've just commented line 78 ReportStatus (thanks to your tip). Now everything works fine - status and grade are updated as I want, nothing gets overriden or something. Maybe not as elegant as it should be, but works :)

This discussion is closed. You can start a new discussion or contact Articulate Support.