From 233de2e316304d40570b20b2ac29f7bf40de63e2 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 9 Nov 2005 02:16:13 +0000 Subject: [PATCH] added popup checker in quiz --- mod/quiz/view.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/quiz/view.php b/mod/quiz/view.php index 3f365f6c609..4bcb1bf7c58 100644 --- a/mod/quiz/view.php +++ b/mod/quiz/view.php @@ -11,7 +11,6 @@ $q = optional_param('q', 0, PARAM_INT); // quiz ID $edit = optional_param('edit', ''); - if ($id) { if (! $cm = get_record("course_modules", "id", $id)) { error("There is no coursemodule with id $id"); @@ -65,7 +64,10 @@ } } - $PAGE->print_header($course->shortname.': %fullname%'); + //only check pop ups if the user is not a teacher, and popup is set + + $bodytags = (isteacher($course->id) or !$quiz->popup)?'':'onload="popupchecker(\'This section of the test is in secure mode, this means that you need to take the quiz in a secure window. Please turn off your popup blocker. Thank you.\');"'; + $PAGE->print_header($course->shortname.': %fullname%','',$bodytags); echo ''; @@ -166,7 +168,6 @@ /// Now print table with existing attempts if ($numattempts) { - /// prepare table header if ($quiz->grade and $quiz->sumgrades) { // Grades used so have more columns in table if ($quiz->grade <> $quiz->sumgrades) { @@ -280,6 +281,7 @@ print_heading(get_string("noquestions", "quiz")); } else { if ($numattempts < $quiz->attempts or !$quiz->attempts) { + if ($available) { $options["id"] = $cm->id; if ($numattempts and $quiz->grade) {