add_to_log($course->id, "quiz", "review", "review.php?id=$cm->id&attempt=$attempt->id", "$quiz->id", "$cm->id");
+/// Load all the questions and states needed by this script
+
+ // load the questions needed by page
+ $pagelist = $showall ? quiz_questions_in_quiz($attempt->layout) : quiz_questions_on_page($attempt->layout, $page);
+ $sql = "SELECT q.*, i.grade AS maxgrade, i.id AS instance".
+ " FROM {$CFG->prefix}question q,".
+ " {$CFG->prefix}quiz_question_instances i".
+ " WHERE i.quiz = '$quiz->id' AND q.id = i.question".
+ " AND q.id IN ($pagelist)";
+ if (!$questions = get_records_sql($sql)) {
+ error('No questions found');
+ }
+
+ // Load the question type specific information
+ if (!get_question_options($questions)) {
+ error('Could not load question options');
+ }
+
+ // Restore the question sessions to their most recent states
+ // creating new sessions where required
+ if (!$states = get_question_states($questions, $quiz, $attempt)) {
+ error('Could not restore question sessions');
+ }
+
/// Print the page header
$strquizzes = get_string("modulenameplural", "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), '', '', '', '', false, '', '', false, '');
+ print_header($course->shortname.': '.format_string($quiz->name), '', '', '', $headtags, false, '', '', false, '');
/// Include Javascript protection for this page
include('protect_js.php');
} else {
$navigation = build_navigation($crumbs);
- print_header_simple(format_string($quiz->name), "", $navigation, "", "", true, $strupdatemodule);
+ print_header_simple(format_string($quiz->name), "", $navigation, "", $headtags, true, $strupdatemodule);
}
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
print_heading(format_string($quiz->name));
}
-/// Load all the questions and states needed by this script
-
- // load the questions needed by page
- $pagelist = $showall ? quiz_questions_in_quiz($attempt->layout) : quiz_questions_on_page($attempt->layout, $page);
- $sql = "SELECT q.*, i.grade AS maxgrade, i.id AS instance".
- " FROM {$CFG->prefix}question q,".
- " {$CFG->prefix}quiz_question_instances i".
- " WHERE i.quiz = '$quiz->id' AND q.id = i.question".
- " AND q.id IN ($pagelist)";
- if (!$questions = get_records_sql($sql)) {
- error('No questions found');
- }
-
- // Load the question type specific information
- if (!get_question_options($questions)) {
- error('Could not load question options');
- }
-
- // Restore the question sessions to their most recent states
- // creating new sessions where required
- if (!$states = get_question_states($questions, $quiz, $attempt)) {
- error('Could not restore question sessions');
- }
-
/// Print infobox
$timelimit = (int)$quiz->timelimit * 60;
/// Print all the questions
- $pagequestions = explode(',', $pagelist);
$number = quiz_first_questionnumber($attempt->layout, $pagelist);
foreach ($pagequestions as $i) {
if (!isset($questions[$i])) {