require_login($course->id, false, $cm);
$isteacher = isteacher($course->id);
+ // if no questions have been set up yet redirect to edit.php
+ if (!$quiz->questions and isteacheredit($course->id)) {
+ redirect('edit.php?quizid='.$quiz->id);
+ }
+
// Get number for the next or unfinished attempt
if(!$attemptnumber = (int)get_field_sql('SELECT MAX(attempt)+1 FROM ' .
"{$CFG->prefix}quiz_attempts WHERE quiz = '{$quiz->id}' AND " .
error("Only teachers authorized to edit the course '{$course->fullname}' can use this page!");
}
+ // if no questions have been set up yet redirect to edit.php
+ if (!$quiz->questions) {
+ redirect('edit.php?quizid='.$quiz->id);
+ }
+
add_to_log($course->id, "quiz", "manualgrading", "grading.php?quizid=$quiz->id", "$quiz->id", "$cm->id");
/// GROUP CODE FROM ATTEMPTS.PHP no sure how to use just yet... need to update later perhaps