From e5e6c961c450bbb7b4348616b0d470ae59c05e3b Mon Sep 17 00:00:00 2001 From: Ankit Kumar Agarwal Date: Wed, 19 Oct 2011 12:42:26 +0530 Subject: [PATCH] MDL-29464 Scorm Fixing regressions on userreport.php --- mod/scorm/userreport.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mod/scorm/userreport.php b/mod/scorm/userreport.php index 1ba07912b03..06dcb37f738 100644 --- a/mod/scorm/userreport.php +++ b/mod/scorm/userreport.php @@ -44,18 +44,18 @@ if ($attempt !== '1') { if (!empty($id)) { $url->param('id', $id); $cm = get_coursemodule_from_id('scorm', $id, 0, false, MUST_EXIST); - $course = $DB->get_record('course', array('id'=>$cm->course), '*', MUST_EXIST); - $scorm = $DB->get_record('scorm', array('id'=>$cm->instance), '*', MUST_EXIST); + $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); + $scorm = $DB->get_record('scorm', array('id' => $cm->instance), '*', MUST_EXIST); } else { if (!empty($b)) { $url->param('b', $b); - $sco = $DB->get_record('scorm_scoes', array('id'=>$b), '*', MUST_EXIST); - $a = $sco->scorm; + $selsco = $DB->get_record('scorm_scoes', array('id' => $b), '*', MUST_EXIST); + $a = $selsco->scorm; } if (!empty($a)) { $url->param('a', $a); - $scorm = $DB->get_record('scorm', array('id'=>$a), '*', MUST_EXIST); - $course = $DB->get_record('course', array('id'=>$scorm->course), '*', MUST_EXIST); + $scorm = $DB->get_record('scorm', array('id' => $a), '*', MUST_EXIST); + $course = $DB->get_record('course', array('id' => $scorm->course), '*', MUST_EXIST); $cm = get_coursemodule_from_instance('scorm', $scorm->id, $course->id, false, MUST_EXIST); } } @@ -84,7 +84,7 @@ if (empty($b)) { } } else { $PAGE->navbar->add("$strattempt $attempt - ".fullname($userdata), new moodle_url('/mod/scorm/userreport.php', array('a'=>$a, 'user'=>$user, 'attempt'=>$attempt))); - $PAGE->navbar->add($sco->title); + $PAGE->navbar->add($selsco->title); } echo $OUTPUT->header(); echo $OUTPUT->heading(format_string($scorm->name)); @@ -153,10 +153,10 @@ if ($scoes = $DB->get_records_select('scorm_scoes', "scorm=? ORDER BY id", array if (!empty($b)) { echo $OUTPUT->box_start('generalbox boxaligncenter'); - echo $OUTPUT->heading(''.format_string($sco->title).''); + echo $OUTPUT->heading(''.format_string($selsco->title).''); echo '
'."\n"; $scoreview = ''; - if ($trackdata = scorm_get_tracks($sco->id, $user, $attempt)) { + if ($trackdata = scorm_get_tracks($selsco->id, $user, $attempt)) { if ($trackdata->score_raw != '') { $scoreview = get_string('score', 'scorm').': '.$trackdata->score_raw; } @@ -210,7 +210,7 @@ if (!empty($b)) { $row[] = s(scorm_format_duration($trackdata->$element)); break; default: - s($trackdata->$element); + $row[] = s($trackdata->$element); break; } $table->data[] = $row; @@ -337,7 +337,7 @@ if (!empty($b)) { } else if (stristr($element, '.learner_response') !== false) { $string="interactionslearnerresponse"; } else if (stristr($element, '.score.min') !== false) { - $string="interactionslscoremin"; + $string="interactionsscoremin"; } else if (stristr($element, '.score.max') !== false) { $string="interactionsscoremax"; } else if (stristr($element, '.score.raw') !== false) {