]> git.mjollnir.org Git - moodle.git/commitdiff
Guests can no longer see or attempt quizzes
authormoodler <moodler>
Sun, 20 Oct 2002 10:13:04 +0000 (10:13 +0000)
committermoodler <moodler>
Sun, 20 Oct 2002 10:13:04 +0000 (10:13 +0000)
mod/quiz/attempt.php
mod/quiz/view.php

index fc0953329ce4df78ad260e62dedac15b0535c72d..4f3d929ed4782e519e4c11735ff8017852de56f1 100644 (file)
 
 /// Print the quiz page
 
+    if (isguest()) {
+        print_heading(get_string("guestsno", "quiz"));
+        print_footer($course);
+        exit;
+    }
+
 /// Actually seeing the questions marks the start of an attempt
  
     if (!$unfinished = quiz_get_user_attempt_unfinished($quiz->id, $USER->id)) {
index 6dc2a9428ddc91aeb3a1b99a685f63b29c4b2649..eeaacc42ebe10ffe394810ab5b860743b0154ce0 100644 (file)
@@ -38,7 +38,7 @@
     add_to_log($course->id, "quiz", "view", "view.php?id=$cm->id", "$quiz->id");
 
     $timenow = time();
-    $available = ($quiz->timeopen < $timenow and $timenow < $quiz->timeclose);
+
 
 // Print the page header
 
@@ -62,6 +62,8 @@
         echo "<P align=right><A HREF=\"report.php?id=$cm->id\">".get_string("viewallanswers","quiz",$answercount)."</A></P>";
     }
 
+    $available = ($quiz->timeopen < $timenow and $timenow < $quiz->timeclose);
+
 // Print the main part of the page
 
     print_heading($quiz->name);
         echo "<P ALIGN=CENTER>".get_string("quizclosed", "quiz", userdate($quiz->timeclose));
     }
 
+    if (isguest()) {
+        print_heading(get_string("guestsno", "quiz"));
+        print_footer($course);
+        exit;
+    }
+
     if ($attempts = quiz_get_user_attempts($quiz->id, $USER->id)) {
         $numattempts = count($attempts);
     } else {