English 中文(简体)
the cmi.total_time parameter does not return anything
原标题:

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.

最佳回答

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





相关问题
PHP Get list of files from Directory (in Moodle)

I want to open a directory and read all the files inside and put them into an array, so far I have: $imagesdir = $CFG->dataroot. /1/themeimages/ ; Which gives me the path to the directory, whats ...

PHP Function Help

I ve written this piece of code, which outputs the profile_display_fields for the $USER: $appearance = profile_display_fields($USER->id); if (empty($appearance)) { //Do nothing ...

Performance tuning Moodle

Our Moodle site is starting to get heavy traffic. As a result, the site is slowing down. What are some of the configuration options I should check right off the bat when performance tuning Moodle? I ...

PHP xmlrpc extension and MAMP

I am trying to get the xmlrpc extension to work for php5 in MAMP (1.8.4). I checked what version of PHP 5 was installed: $ /Applications/MAMP/bin/php5/bin/php -v PHP 5.2.11 (cli) (built: Dec 12 2009 ...

热门标签