session and total time tracking problem

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Picture of Aleksey Metelskiy
session and total time tracking problem


I am using moodle version 2.6.2(Build 20140411) on windows server 2008 with IIS and a bit modified essential theme.

What am I trying to archive, is to track time in every SCO asset in html-javascript based scorm package to let moodle calculate total time correctly.

I am using a bit tinkered ADL Technical Team SCOFunctions and APIWrapper scripts, which are tracking data only from last SCO item selected, before page unload, as you can see in SCORM API log.


After some research I found out that moodle itself tracks SCO item start time, and sets it as complete just after activation. But it doesnt set the end time.

I think the solution may be if we can somehow catch the navigation event for the iframe, and then set and commit session_time variable, but I don't fully understand how to implement this.


Scorm API activity log, sample SCORM package with modified js files, and scorm activity report included.


Please help me with this, I am stuck for days with this issue.

Average of ratings: -
Picture of Aleksey Metelskiy
Re: session and total time tracking problem

If someone interested,

Solved problem by adding window.onunload method, so it will work on most browsers.

Average of ratings: -
Picture of Matteo Scaramuccia
Re: session and total time tracking problem
Group Core developersGroup Particularly helpful MoodlersGroup Plugin developers

Hi Aleksey,
thanks for sharing your solution.

BTW, to get rid of the red lines in your API logging, please update your imsmanifest.xml file by declaring your "assets" as real SCOs i.e. add  adlcp:scormtype="sco" into your <resource /> entries and add the adlcp namespace too i.e. xmlns:adlcp="" and the new entries in the xsi:schemaLocation, " imscp_rootv1p1p2.xsd".
Indeed, your package has been declared as IMS while it also contains SCOs i.e. contents able to make SCORM calls and not just simple Assets.


Average of ratings: -