Register in an LMS the highest score of 2 possible attempts

Jul 29, 2021

Hello, I have a question, i need to register in an LMS the highest score of 2 possible attempts of a quiz, but I have not been able to do it, I only register the last score obtained, can you help me?.

8 Replies
Scott Wiley

Sounds like you may need to utilize some custom variables to hold your scores, instead of the built-in quiz functionality.

Then you could apply a JavaScript trigger to check/compare the two and send the results to your LMS.

FYI - there are slightly different JS calls depending on whether you publish to SCORM 1.2 vs SCORM 2004.

Example SCORM 1.2

//get LMS API
var lmsAPI = parent;

//set score; the first number is the score
//lmsApI.SetScore(yourscore, Max score, Min score);
lmsAPI.SetScore(90, 100, 0);

//set status; possible values: "completed", "incomplete", "failed", "passed"
lmsApI.SetStatus("completed");

Example SCORM 2004

// get LMS API
var lmsAPI = parent;

// set score; the first number is the score
// lmsAPI.SetPointBasedScore(intScore, maxScore, intMinScore);
lmsAPI.SetPointBasedScore(100, 100, 0);

// set passed/completed
lmsAPI.SCORM2004_SetPassed();
lmsAPI.SCORM2004_SetCompleted();
Scott Wiley

You can apply that JavaScript from anywhere in your course. But likely it would make the most sense to have a final/last landing page from where you can trigger the JS to set the final score.

// get LMS API
var lmsAPI = parent;
// set score; the first number is the score
// lmsAPI.SetPointBasedScore(intScore, maxScore, intMinScore);
lmsAPI.SetPointBasedScore(yourVariableHere, 100, 0);
Nicole van Santen

Hi Scott, thank you so much for responding, and apologies I contacted you, being 'a stranger'.

Attached you will see a printscreen of the JS I copie/pasted from your post.

Like you can see I've put it on the last (result) slide.

So far Canvas still takes the last result, not the best result.

If you would have any more ideas how to make this work please let me know.

 

Thank you again for reaching out, and helping me!

 

Enjoy your weekend,

Nicole

Scott Wiley

I haven't been doing much Storyline development for a while now. I believe you can set up custom variables to track a score. This would mean you'd have to also add custom triggers to your question submit button to set your custom variables. When it comes time to submit the results, you'll have to do a comparison of the first try score value with the second score value and whichever is larger, plug into the LMS set score call.

Oh, and one other thing, you'll also have to add a line to set completion. Usually there is a score threshold considered 'passing' so you can use that to determine if it should be set to completed.

// set passed/completed
lmsAPI.SCORM2004_SetPassed();
lmsAPI.SCORM2004_SetCompleted();