From: moodler Date: Thu, 8 Jul 2004 08:28:50 +0000 (+0000) Subject: FIxed small bug in password checking X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=60d37a2d0f4732242639f9e57b97c0830428d336;p=moodle.git FIxed small bug in password checking --- diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index 300220d41c..3bd337eab3 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -80,7 +80,7 @@ } /// Check password access - if ($quiz->password) { + if ($quiz->password and empty($_POST['q'])) { if (empty($_POST['quizpassword'])) { print_heading($quiz->name); @@ -88,14 +88,14 @@ print_simple_box(format_text($quiz->intro), "CENTER"); echo "
\n"; - echo "
id\">\n"; + echo "id\">\n"; print_simple_box_start("center"); echo "
\n"; print_string("requirepasswordmessage", "quiz"); echo "

\n"; echo " "; - echo " \n"; + echo " \n"; echo "
\n"; print_simple_box_end(); @@ -108,7 +108,7 @@ if (strcmp($quiz->password, $_POST['quizpassword']) !== 0) { error(get_string("passworderror", "quiz"), "view.php?id=$cm->id"); } - unset($_POST); /// needed so as not to confuse later code dealing with submitted answers + unset($_POST['quizpassword']); /// needed so as not to confuse later code dealing with submitted answers } }