Skip to main content
Participant
February 15, 2017
Question

Downtime - stop counting time in SCORM

  • February 15, 2017
  • 3 replies
  • 473 views

I actually produces SCORM packages in Captivate 9 and publishes in Moodle.

In some cases I see that the student leaves the course without close the browser, and the time I track spends a long time. It is so bad for my statistics because I need to know the time that the students really use my courses.

Is there a way to pause the time counter when the student keep inactive for a little time (downtime), like 60 seconds?

Or to disconect the student when he spend about 60 seconds without clicking on anything?

Perhaps this solution is not in Captivate, but if there is a solution in Moodle I would be grateful too.

This topic has been closed for replies.

3 replies

Participant
February 27, 2017

We developed another solution that was usefull for us and can be usefull for anyone:

This solution is based on javascript. We added the follow code into the javascript box. In general, it closes the active scorm when the user takes more than 10 minutes inactive. Thereafter, Moodle stops counting time for this scorm. The student can comeback to the scorm whenever he want.

__________

<script>

var tempoEmMinutos = 10;

var interfaceObj;

var eventEmitterObj;

var timer;

window.addEventListener("moduleReadyEvent", function(evt)

{

    interfaceObj = evt.Data;

    eventEmitterObj = interfaceObj.getEventEmitter();

    timer = window.setTimeout(onTimeOut, 1000*60*tempoEmMinutos);

    if(eventEmitterObj){

        eventEmitterObj.addEventListener("CPAPI_SLIDEENTER",resetTimeout);

        eventEmitterObj.addEventListener("CPAPI_SLIDEEXIT",resetTimeout);

        eventEmitterObj.addEventListener("CPAPI_STARTPLAYBARSCRUBBING",resetTimeout);

        eventEmitterObj.addEventListener("CPAPI_ENDPLAYBARSCRUBBING",resetTimeout);

        eventEmitterObj.addEventListener("CPAPI_INTERACTIVEITEMSUBMIT",resetTimeout);

        eventEmitterObj.addEventListener("CPAPI_MOVIEPAUSE",resetTimeout);

        eventEmitterObj.addEventListener("CPAPI_MOVIERESUME",resetTimeout);

        eventEmitterObj.addEventListener("CPAPI_MOVIESTART",resetTimeout);

        eventEmitterObj.addEventListener("CPAPI_MOVIESTOP",resetTimeout);

        eventEmitterObj.addEventListener("CPAPI_QUESTIONSKIP",resetTimeout);

        eventEmitterObj.addEventListener("CPAPI_QUESTIONSUBMIT",resetTimeout);

        eventEmitterObj.addEventListener("CPAPI_VARIABLEVALUECHANGED",resetTimeout);

    }

});

function resetTimeout(){

    window.clearTimeout(timer);

    timer = window.setTimeout(onTimeOut, 1000*60*tempoEmMinutos);

    console.log('reset');

}

function onTimeOut(){

    parent.parent.fecharVideo(true);

}

</script>

__________

Thanks.

Participant
February 16, 2017

Thanks for your contributtion TLCMediaDesign​.

Is there anyone that suggest an alternative?

If I don't find, I will follow your steps TLCMediaDesign

TLCMediaDesign
Inspiring
February 15, 2017

That would be possible, but difficult.

In theory you would need to create an array of the amount of time spent on each slide and do some kind of calculation to write the session time. You would need to start a timer on enter of each slide and populate the array with the time if less than 60 seconds, or enter 60 seconds if the timer goes above 60 seconds.

When the user exits you would need to do the calculation by adding all values in the array, convert to the appropriate time and write the value to the session time and total time.

Here is a page that explains how they work.

Step 17 – cmi.core.total_time and cmi.core.session_time | VSSCORM