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 als开发者_StackOverflow中文版o try on cloud.scorm.com and cmi.total_time returns each time PT0H0M0S. EDIT2. Ooops I deleted Donal's edit.
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!
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
精彩评论