Forum Discussion

LuisGomez-bb5a4's avatar
LuisGomez-bb5a4
Community Member
4 years ago

Register in an LMS the highest score of 2 possible attempts

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?.

  • ScottWiley1's avatar
    ScottWiley1
    Community Member

    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();
  • Hi Scott, although this topic is more than 2 years old.... Should that (SCORM 2004) snippet be on the last page of Articulate the E-learning (The passed/fail slide)? Sorry for asking this, but I'm not that familiar with JavaScript, so most of my JS actions are copy/paste :(.

     

    Kind regards, Nicole

    • StevenBenassi's avatar
      StevenBenassi
      Staff

      Hi Nicole!

      I just wanted to pop in and share that since this discussion is a bit older, Scott may no longer be subscribed. If you want to reach out to him directly, you may do so by clicking on his name and selecting 'Contact Me'.

      Have a great rest of your week!

  • Hi Steven,

    thank you so much for contributing. I will do that.

    Kind regards, Nicole

  • ScottWiley1's avatar
    ScottWiley1
    Community Member

    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);
  • 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

  • ScottWiley1's avatar
    ScottWiley1
    Community Member

    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();
  • Hello Scott, thank you once more. 

    I think what you discribe goes way beyond my skills :(.

    But thank you anyway!

     

    Kind regards,

    Nicole