Permalink
Browse files

MDL-33702 scorm: Adding support for '2004 SCORM' progress status elem…

…ents
  • Loading branch information...
1 parent d875cf9 commit 57a32d3eb6ea3e5a908a7bb4aa3140309bcc2e3f @ankitagarwal ankitagarwal committed Jun 28, 2012
Showing with 15 additions and 2 deletions.
  1. +10 −1 mod/scorm/locallib.php
  2. +5 −1 mod/scorm/userreport.php
@@ -450,6 +450,7 @@ function scorm_get_tracks($scoid, $userid, $attempt='') {
// Defined in order to unify scorm1.2 and scorm2004
$usertrack->score_raw = '';
$usertrack->status = '';
+ $usertrack->progress = '';
$usertrack->total_time = '00:00:00';
$usertrack->session_time = '00:00:00';
$usertrack->timemodified = 0;
@@ -463,7 +464,15 @@ function scorm_get_tracks($scoid, $userid, $attempt='') {
$track->value = 'notattempted';
}
$usertrack->status = $track->value;
- break;
+ break;
+ case 'cmi.success_status':
+ $usertrack->progress = $track->value;
+ break;
+ case 'cmi.progress_measure':
+ if(!empty($track->value) && (empty($usertrack->progress) || $usertrack->progress == 'unknown') ) {
+ $usertrack->progress = $track->value;
+ }
+ break;
case 'cmi.core.score.raw':
case 'cmi.score.raw':
$usertrack->score_raw = (float) sprintf('%2.2f', $track->value);
@@ -127,7 +127,11 @@
$score = $trackdata->score_raw;
}
if ($trackdata->status == '') {
- $trackdata->status = 'notattempted';
+ if (!empty($trackdata->progress)) {
+ $trackdata->status = $trackdata->progress;
+ } else {
+ $trackdata->status = 'notattempted';
+ }
}
$detailslink = '<a href="userreport.php?b='.$sco->id.'&amp;user='.$user.'&amp;attempt='.$attempt.'" title="'.
get_string('details', 'scorm').'">'.get_string('details', 'scorm').'</a>';

0 comments on commit 57a32d3

Please sign in to comment.