From 2d05b47209461dee49734dbc41713fd84fccfe7a Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 24 Apr 2007 17:32:21 +0000 Subject: [PATCH] MDL-6368 and MDL-6369 - allow question type plugins to easily provide some bits of Javascript and CSS - I forgot about the review page. --- mod/quiz/review.php | 91 +++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/mod/quiz/review.php b/mod/quiz/review.php index 9e83fff6785..a66a55abb15 100644 --- a/mod/quiz/review.php +++ b/mod/quiz/review.php @@ -78,50 +78,6 @@ add_to_log($course->id, "quiz", "review", "review.php?id=$cm->id&attempt=$attempt->id", "$quiz->id", "$cm->id"); -/// Print the page header - - $strquizzes = get_string("modulenameplural", "quiz"); - $strreview = get_string("review", "quiz"); - $strscore = get_string("score", "quiz"); - $strgrade = get_string("grade"); - $strbestgrade = get_string("bestgrade", "quiz"); - $strtimetaken = get_string("timetaken", "quiz"); - $strtimecompleted = get_string("completedon", "quiz"); - $stroverdue = get_string("overdue", "quiz"); - - if (!empty($popup)) { - define('MESSAGE_WINDOW', true); // This prevents the message window coming up - print_header($course->shortname.': '.format_string($quiz->name), '', '', '', '', false, '', '', false, ''); - /// Include Javascript protection for this page - include('protect_js.php'); - } else { - $strupdatemodule = has_capability('moodle/course:manageactivities', $coursecontext) - ? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz')) - : ""; - - $crumbs[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); - $crumbs[] = array('name' => format_string($quiz->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); - $crumbs[] = array('name' => $strreview, 'link' => '', 'type' => 'title'); - - $navigation = build_navigation($crumbs); - - print_header_simple(format_string($quiz->name), "", $navigation, "", "", true, $strupdatemodule); - } - echo ''; // for overlib - -/// Print heading and tabs if this is part of a preview - if (has_capability('mod/quiz:preview', $context)) { - if ($attempt->userid == $USER->id) { // this is the report on a preview - $currenttab = 'preview'; - } else { - $currenttab = 'reports'; - $mode = ''; - } - include('tabs.php'); - } else { - print_heading(format_string($quiz->name)); - } - /// Load all the questions and states needed by this script // load the questions needed by page @@ -146,6 +102,52 @@ error('Could not restore question sessions'); } +/// Print the page header + + $strquizzes = get_string("modulenameplural", "quiz"); + $strreview = get_string("review", "quiz"); + $strscore = get_string("score", "quiz"); + $strgrade = get_string("grade"); + $strbestgrade = get_string("bestgrade", "quiz"); + $strtimetaken = get_string("timetaken", "quiz"); + $strtimecompleted = get_string("completedon", "quiz"); + $stroverdue = get_string("overdue", "quiz"); + + $pagequestions = explode(',', $pagelist); + $headtags = get_html_head_contributions($pagequestions, $questions, $states); + if (!empty($popup)) { + define('MESSAGE_WINDOW', true); // This prevents the message window coming up + print_header($course->shortname.': '.format_string($quiz->name), '', '', '', $headtags, false, '', '', false, ''); + /// Include Javascript protection for this page + include('protect_js.php'); + } else { + $strupdatemodule = has_capability('moodle/course:manageactivities', $coursecontext) + ? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz')) + : ""; + + $crumbs[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity'); + $crumbs[] = array('name' => format_string($quiz->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance'); + $crumbs[] = array('name' => $strreview, 'link' => '', 'type' => 'title'); + + $navigation = build_navigation($crumbs); + + print_header_simple(format_string($quiz->name), "", $navigation, "", $headtags, true, $strupdatemodule); + } + echo ''; // for overlib + +/// Print heading and tabs if this is part of a preview + if (has_capability('mod/quiz:preview', $context)) { + if ($attempt->userid == $USER->id) { // this is the report on a preview + $currenttab = 'preview'; + } else { + $currenttab = 'reports'; + $mode = ''; + } + include('tabs.php'); + } else { + print_heading(format_string($quiz->name)); + } + /// Print infobox $timelimit = (int)$quiz->timelimit * 60; @@ -239,7 +241,6 @@ /// Print all the questions - $pagequestions = explode(',', $pagelist); $number = quiz_first_questionnumber($attempt->layout, $pagelist); foreach ($pagequestions as $i) { if (!isset($questions[$i])) {