Manually setting cmi.score.min and cmi.score.max in LMS?

_ Community Member Posts: 82 ☆ Roadie ☆
Hi Everyone,

Wondering if anyone has any experience in manually setting LMS variables from within Lectora?

I'm deploying an assessment module to Brightspace (Desire2Learn) LMS - the overall learner score (cmi.score.raw) is being successfully communicated to the LMS, however I also need to write back the cmi.score.min and cmi.score.max variables for the score to be correctly stored in the LMS's 'Gradebook'.

Is it possible to manually set these values within Lectora so they're written to the LMS upon completion of the assessment?

I suspect this can be done with a Javascript call or HTML extension but I don't have the faintest idea where to start!

Any clues? Thanks!



  • _
    _ Community Member Posts: 82 ☆ Roadie ☆
    Figured it out - I hardcoded the values into trivantis-cookies.js in the SCORM package:
     if( this.aiccgroup ) {
              LMSSetValue(, lmsVal )
              if( == 'cmi.score.raw' ){
                var scaled = this.value / 100
                LMSSetValue( 'cmi.score.scaled', scaled )
                LMSSetValue( 'cmi.score.min', 0 )
                LMSSetValue( 'cmi.score.max', 100 )
                LMSCommit( "" );

    Probably not the most elegant solution but it does work!
  • ivancaesbroeck1298
    ivancaesbroeck1298 Community Member Posts: 12
    Hi Cam, could you maybe help me out.

    Where exactly would you paste that code in the trivantis-cookie.js?
  • ivancaesbroeck1298
    ivancaesbroeck1298 Community Member Posts: 12
    Ok never mind, trial and error got me figuring it out.

    For those coming across this post:

    First of all, this concerns SCORM 2004 packages!! Not 1.2. See more information here:

    Secondly, I use this technique for the following situation: I have a course, with questions that are not part of a test and are not graded as such. All I do is use a button right at the end of the module to 1) set the course to passed, 2) to completion, 3) to tell the LMS "Give users 100(%)" and 4) to exit the course.

    Thirdly, because of that I want to modify the code to reflect a minimum score of 0, and a maximum score of 100. You can change this to reflect whatever it is that you need, but be aware that you might need to edit your cmi.raw.score as well (mine is 100). I have not tried this myself, though.

    In publishing to Lectora SCORM 2004 (3rd edition) you need to edit the trivantis-cookie.js file in your zipped package (unzip first, edit, and then rezip).

    Find the following code in your original file (see image 'trivantis cookie_original file'):
    if (A.aiccgroup){LMSSetValue(,C);if ('cmi.score.raw'){var D=A.value/100;LMSSetValue('cmi.score.scaled',D);LMSCommit("");}
    Now modify it to (see image 'trivantis cookie_edited file'):
    if (A.aiccgroup){LMSSetValue(,C);if ('cmi.score.raw'){var D=A.value/100;LMSSetValue('cmi.score.scaled',D);LMSSetValue('cmi.score.min',0);LMSSetValue('cmi.score.max',100);LMSCommit("");}
    And that's what worked for me!

    See image 'scorm cloud_registration state'. Here you see cmi.min.score and cmi.max.score filled in just as I wanted them to be.
  • _
    _ Community Member Posts: 82 ☆ Roadie ☆
    <span class="bbp-user-nicename"><span class="handle-sign">@&lt;/span>ivancaesbroeck1298</span> Sorry for the lack of reply - I didn't see the notification until just now!

    Glad you figured it out. I can't even remember where I was trying to deploy this course or why I needed to use SCORM 2004.