Permalink
Browse files

MDL-33702 scorm: refactoring interraction report to use '2004 SCORM' …

…score elements
  • Loading branch information...
ankitagarwal committed Jun 28, 2012
1 parent 57a32d3 commit 9381c28084115220502bfd37ec7e93ced91491cb
Showing with 7 additions and 12 deletions.
  1. +1 −1 mod/scorm/locallib.php
  2. +2 −7 mod/scorm/report/interactions/report.php
  3. +4 −4 mod/scorm/userreport.php
View
@@ -469,7 +469,7 @@ function scorm_get_tracks($scoid, $userid, $attempt='') {
$usertrack->progress = $track->value;
break;
case 'cmi.progress_measure':
- if(!empty($track->value) && (empty($usertrack->progress) || $usertrack->progress == 'unknown') ) {
+ if (!empty($track->value) && (empty($usertrack->progress) || $usertrack->progress == 'unknown') ) {
$usertrack->progress = $track->value;
}
break;
@@ -456,13 +456,8 @@ function display($scorm, $cm, $course, $download) {
if ($trackdata->score_raw != '') {
$score = $trackdata->score_raw;
// add max score if it exists
- if ($scorm->version == 'SCORM_1.3') {
- $maxkey = 'cmi.score.max';
- } else {
- $maxkey = 'cmi.core.score.max';
- }
- if (isset($trackdata->$maxkey)) {
- $score .= '/'.$trackdata->$maxkey;
+ if (isset($trackdata->score_max)) {
+ $score .= '/'.$trackdata->score_max;
}
// else print out status
} else {
View
@@ -279,16 +279,16 @@
$printedelements[]=$objectiveid;
// Merge 2004 and 1.2 SCORM formats
- if (!scorm_version_check($scorm->version, SCORM_13)) {
+ if (scorm_version_check($scorm->version, SCORM_13)) {
$sucstatuskey = 'cmi.objectives.'.$i.'.success_status';
$progstatuskey = 'cmi.objectives.'.$i.'.progress_measure';
$compstatuskey = 'cmi.objectives.'.$i.'.completion_status';
$statuskey = 'cmi.objectives.'.$i.'.status';
- if(isset($trackdata->$sucstatuskey)) {
+ if (isset($trackdata->$sucstatuskey)) {
$trackdata->$statuskey = $trackdata->$sucstatuskey;
- } elseif(isset($trackdata->$progstatuskey)) {
+ } elseif (isset($trackdata->$progstatuskey)) {
$trackdata->$statuskey = $trackdata->$progstatuskey;
- } elseif(isset($trackdata->$compstatuskey)) {
+ } elseif (isset($trackdata->$compstatuskey)) {
$trackdata->$statuskey = $trackdata->$compstatuskey;
}
}

0 comments on commit 9381c28

Please sign in to comment.