MDL-33702 scorm: Adding support for '2004 SCORM' objectives status elements
This commit is contained in:
@@ -132,6 +132,7 @@ if ($scoes = $DB->get_records_select('scorm_scoes', "scorm=? ORDER BY id", array
|
||||
$detailslink = '<a href="userreport.php?b='.$sco->id.'&user='.$user.'&attempt='.$attempt.'" title="'.
|
||||
get_string('details', 'scorm').'">'.get_string('details', 'scorm').'</a>';
|
||||
} else {
|
||||
$trackdata = new stdClass();
|
||||
$trackdata->status = 'notattempted';
|
||||
$trackdata->total_time = ' ';
|
||||
$detailslink = ' ';
|
||||
@@ -272,11 +273,26 @@ if (!empty($b)) {
|
||||
while (isset($trackdata->$objectiveid)) {
|
||||
$existobjective = true;
|
||||
$printedelements[]=$objectiveid;
|
||||
|
||||
// Merge 2004 and 1.2 SCORM formats
|
||||
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)) {
|
||||
$trackdata->$statuskey = $trackdata->$sucstatuskey;
|
||||
} elseif(isset($trackdata->$progstatuskey)) {
|
||||
$trackdata->$statuskey = $trackdata->$progstatuskey;
|
||||
} elseif(isset($trackdata->$compstatuskey)) {
|
||||
$trackdata->$statuskey = $trackdata->$compstatuskey;
|
||||
}
|
||||
}
|
||||
$elements = array(
|
||||
$objectiveid,
|
||||
'cmi.objectives.'.$i.'.status',
|
||||
'cmi.objectives.'.$i.'.score.raw',
|
||||
'cmi.objectives.'.$i.'.score.min',
|
||||
'cmi.objectives.'.$i.'.score.raw',
|
||||
'cmi.objectives.'.$i.'.score.max');
|
||||
$row = array();
|
||||
foreach ($elements as $element) {
|
||||
|
||||
Reference in New Issue
Block a user