SCORM 2004 MDL-18756 - only return previous datamodel elements on re-launch if cmi...
authorDan Marsden <Dan@digitalclay.co.nz>
Wed, 10 Nov 2010 23:22:31 +0000 (23:22 +0000)
committerDan Marsden <Dan@digitalclay.co.nz>
Wed, 10 Nov 2010 23:22:31 +0000 (23:22 +0000)
mod/scorm/api.php

index 8f0fad2..bed65d9 100644 (file)
@@ -43,7 +43,8 @@
     require_login($course->id, false, $cm);
 
     if ($usertrack = scorm_get_tracks($scoid,$USER->id,$attempt)) {
-        if ((isset($usertrack->{'cmi.exit'}) && ($usertrack->{'cmi.exit'} != 'time-out')) || ($scorm->version != "SCORM_1.3")) {
+        //according to SCORM 2004 spec(RTE V1, 4.2.8), only cmi.exit==suspend should allow previous datamodel elements on re-launch
+        if ($scorm->version != "SCORM_1.3" || (isset($usertrack->{'cmi.exit'}) && ($usertrack->{'cmi.exit'} == 'suspend'))) {
             foreach ($usertrack as $key => $value) {
                 $userdata->$key = addslashes_js($value);
             }