Skip to main content
Participant
November 13, 2020
Question

Captivate 2019 - Using JS to report tracking markers

  • November 13, 2020
  • 1 reply
  • 199 views

Our organisation is moving from swf to HTML5 and I noticed that when I publish the projects in HTML5 they behave differently on our MLE. We have a project where the questions are just knowledge checks and don't score. We put 4 marker scores on the Continue buttons at fixed points as the user goes through. So as the user clicks the first scoring button they get 1 point so that's 25%. Once they have clicked all 4 scoring buttons, the course is complete, because it's set to Quiz is passed. Not so in HTML5, because I put a failure caption on the Continue button if the user doesn't click the Continue button but clicks somewhere else, the point isn't awarded to them even when they click it correctly. This then results in an incomplete attempt even though the user gets to the end. So you say, set it to all slides viewed, this isn't a good option for us as it doesn't always work on our MLE and network. There is a time lag and if the user goes too quickly, then the API can't keep up and again the user completes the course but it's still showing incomplete because the fact that the last few slides were actually viewed did not get back to the server.

So I want to use JavaScript to do the tracking. I have had some success in that I can use the following to get the project to complete when the user gets to the last slides. I put the code in an advanced action which triggers on enter.

 

SCORM_CallLMSSetValue('cmi.core.score.raw', 100);
SCORM_CallLMSSetValue('cmi.core.lesson_status', 'completed');
SCORM_CallLMSCommit();
SCORM_CallLMSFinish();

 

Earlier on it the project I use

 

SCORM_CallLMSSetValue('cmi.core.score.min', 0);
SCORM_CallLMSSetValue('cmi.core.score.max', 100);
SCORM_CallLMSSetValue('cmi.core.score.raw', 25);
SCORM_CallLMSCommit();

 

This sets things up but it doesn't set the score to 25%. I know there are alternatives, such as don't put a failure caption on the Continue button, but it's become a bit of a challenge now. I just want to know why I can set the score to 100% at the end but I can't set it to 25% on the first few slides. Is it because Captivate itself is also controlling the score and so there is a conflict? The JS code to set the score to 100% and status to complete comes after the knowledge check questions and the results slide, is that the answer.

Many thanks for any help you can give me.

    This topic has been closed for replies.

    1 reply

    TLCMediaDesign
    Inspiring
    November 13, 2020

    I would put your course on the SCORM cloud so you can see a log of all of the SCORM calls that are being made. You can then see if CP is overwriting your calls.

     

    My initial thought is that if you are setting up the course completion to quiz is passed, it will never be passed since you aren't using an actual quiz but are using knowledge checks. Is there a reason you don't use the Quiz?

    Participant
    November 13, 2020
    Thanks for responding so quickly. I've not used SCORM cloud so if you could
    point me in the right direction that would be great. I did use the quiz
    when I published in swf because it was a more reliable way of tracking
    completion. Also by putting the score on the Continue buttons we got
    interaction data back which we could check if there were any disputes.
    After posting my last, I thought I would change a few things, isn't it
    funny just by writing your problem down makes you look at it differently
    and sometimes solve it yourself. As you point out it doesn't need to be a
    quiz as none of the questions are scored and I don't want scoring on the
    Continue buttons anyway. So I changed it to slides viewed and set it to
    100% so it wouldn't complete until the last slide had been viewed. I tested
    it and all the JavaScript triggered properly. So after getting to slide 4
    you can exit and it shows 25% complete, if you exit at slide 6 it shows 50%
    complete and so on. On slide 10 if you exit it shows you at 100% but the
    course is not showing complete, which is correct because not all the slides
    have been viewed yet and the JS that changes the course status to complete
    is on the next slide. So when you go back in and go to the next slide and
    come out again the course is showing complete and the score is 100%. There
    are still a few slides in the course not viewed yet which proves it was the
    JS that was working. So this proves that because I had it set to 'Quiz is
    passed' the code in Captivate itself was conflicting with or overwriting my
    JS. By setting it to slides viewed Captivate allowed my JS to work
    properly. I can now determine how far the user got in the course by their
    score and even if they rush through it, it should still complete properly
    because I have 2 mechanisms now to show course completion, namely my own JS
    and Captivate itself. Just need to check if the back button messes things
    up. If a user gets to the end and then decides to go back to the beginning,
    will that then leave them with a score of 25%. I expect it will but I
    should be able to use a variable in an advanced action to detect if the
    slide has been viewed already and if so don't trigger the JS again. Good to
    talk and thanks again.