session and total time tracking problem

session and total time tracking problem

by Aleksey Metelskiy -
Number of replies: 2

Hi.

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.

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.

Attachment report.png
Average of ratings: -
In reply to Aleksey Metelskiy

Re: session and total time tracking problem

by Aleksey Metelskiy -

If someone interested,

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

In reply to Aleksey Metelskiy

Re: session and total time tracking problem

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of 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="http://www.adlnet.org/xsd/adlcp_rootv1p2" and the new entries in the xsi:schemaLocation, "http://www.imsproject.org/xsd/imscp_rootv1p1p2 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.

HTH,
Matteo