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

This commit is contained in:
Ankit Agarwal 2012-06-28 14:53:32 +08:00
parent 57a32d3eb6
commit 9381c28084
3 changed files with 7 additions and 12 deletions

View File

@ -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;

View File

@ -456,13 +456,8 @@ class scorm_interactions_report extends scorm_default_report {
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 File

@ -279,16 +279,16 @@ if (!empty($b)) {
$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;
}
}