/// 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)) {
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
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 {