views:

117

answers:

2

Hi,

I am programming a SCORM 2004 product. I can update the session_time, it works. I can set the status (passed, failed, etc...) I also can get the cmi.location time. No problems !

But I don't succeed to get the total time ! (cmi.total_time). I have tested on 2 LMS :

  • On Ganesha the API.GetValue('cmi.total_time') is an empty string.

  • On Moodle the API.GetValue('cmi.total_time') is just a "P".

However i do have the correct logs with correct session times.

Anybody have an idea ?

Thank you !

EDIT. I also try on cloud.scorm.com and cmi.total_time returns each time PT0H0M0S. EDIT2. Ooops I deleted Donal's edit.

+2  A: 

Based upon the information you've provided, I'm guessing that you're trying to set cmi.session_time and get cmi.total_time in the same learner session, which wouldn't give the response you're expecting.

cmi.total_time contains the total duration of all learner sessions prior to the current one, meaning that it won't contain the value you'd expect it to have until the second learner session.

Once you've set cmi.session_time, close the current learner session by leaving the SCO you're on, and then coming back to it. You should then see that cmi.total_time is now populated with a valid value.

Good Luck!

E-man
Thanks for your answer. However I have already tried it.Indeed The cmi.total_time is the total of all session time ran by the user. But if I leave the SCO, even after 3 SCO sessions (successfully registered) I don't get the cmi.total_time...
Nephila
It worked for me. I guess that's all the help I can offer. Good luck!
E-man
A: 

Hi Donal,

When you resume the second session and try to retrieve total time, are you able to retrieve the value you stored for cmi.location in the first session? If not, then you are probably not suspending the session. In order for data to be available in the next launch, you need to set cmi.exit to suspend before terminating the first session.

Mike

Mike Rustici
Hi Mike.Indeed i am able to retrieve the value stored in cmi.location.
Nephila
Not sure why is going on in that case. If you test your course in SCORM Cloud, you can send me the debug logs and I'll be happy to take a look. Email me at mike at scorm dot come.
Mike Rustici
Ok Mike, thank you.Here a link with the useful logs :http://www.freeimagehosting.net/image.php?c66e29710c.pngBefore trying to retrieve the cmi.total_time I dont have to set it (in previous session) because it is RO. Also in SCORM 1.2 the total_time is calculate by the LMS using the cmi.session_time.However i dont find in logs any API.SetValue("cmi.session_time", string );And my code is :API.SetValue("cmi.location", getTc() );API.SetValue("cmi.session_time", "PT2H4M1S" );...
Nephila