event to find cmi.core.session_time in SCORM objects

event to find cmi.core.session_time in SCORM objects

by Bharath Parlapalli -
Number of replies: 2

Hello All,

Working on Moodle version 2.7

Background:

I need to track the amount of time spent by a user in every session as soon as the session ends. When I ran the SCORM debugger tool, I see that the cmi.core.session_time is being sent. 

Wed, 05 Apr 2017 14:29:34 GMT: LMSInitialize("", "") => 101
Wed, 05 Apr 2017 14:29:34 GMT: LMSGetErrorString("101", "General exception") => 0
Wed, 05 Apr 2017 14:29:34 GMT: LMSSetValue("cmi.core.lesson_location", "2") => 0
Wed, 05 Apr 2017 14:29:42 GMT: LMSSetValue("cmi.core.session_time", "0000:00:56.41") => 0

This time value, according to the docs - is added to 

cmi.core.total_time

however, this is not being updated at the end of every session. for example: if a SCORM module has a bunch of slides and a test at the end, and a user closes the SCORM after a few slides without taking the test, his time spent value is NOT being recorded in the value: 


cmi.core.total_time (in the scorm_scoes_track table)

but the value:

cmi.core.session_time

is being sent in the SCORM debugger tool.


Question:

is there a way we can write an event to capture the core.session_time value? where in the mod/scorm module is this value being saved or added to the cmi.core.total_time (so I can trigger the event there)?


Any other ideas on capturing this value are welcome.


thanks for any help in advance. I will be updating the status of the issue as I go along and try to figure this out.

Average of ratings: -
In reply to Bharath Parlapalli

Re: event to find cmi.core.session_time in SCORM objects

by Sasikala P A -
Picture of Translators


According to the specification when LMSFinish() is called at the end of the session, the value in the cmi.core.session_time element should be added to the value stored in the cmi.core.total_time  element, and the value in the cmi.core.session_time element should be reset. To get the value you can use a script in the LMSFinish() function and get the value of cmi.core.session_time before resetting. Hope this will help.

In reply to Sasikala P A

Re: event to find cmi.core.session_time in SCORM objects

by Bharath Parlapalli -

thank you for the reply.

the value cmi.core.total_time is not always being saved in the DB and thats causing a lot of issues. Even though the SCORM seems to send the cmi.core.session_time, the total_time is not being updated.

Do you know which part of the mod/scorm code is being called when the SCORM javascript calls LMSFinish() ? that ways I can track all the data coming in from SCORM package into mod/scorm and then track the session_time value from the PHP script (instead of the SCORM javascript).