mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-33702 scorm: refactoring interraction report to use '2004 SCORM' score elements
This commit is contained in:
parent
57a32d3eb6
commit
9381c28084
@ -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 @@ 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 {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user