diff --git a/mod/quiz/editlib.php b/mod/quiz/editlib.php index bbf636e7129..fcd35658fa8 100644 --- a/mod/quiz/editlib.php +++ b/mod/quiz/editlib.php @@ -197,8 +197,6 @@ function quiz_print_question_list($quiz, $allowdelete=true, $showbreaks=true) { return; } - $order = explode(",", $quiz->questions); - if (!$questions = get_records_sql("SELECT q.*,c.course FROM {$CFG->prefix}quiz_questions q, {$CFG->prefix}quiz_categories c @@ -213,7 +211,13 @@ function quiz_print_question_list($quiz, $allowdelete=true, $showbreaks=true) { $count = 0; $qno = 1; $sumgrade = 0; - $total = count($order); + $order = explode(",", $quiz->questions); + $lastindex = count($order)-1; + // If the list does not end with a pagebreak then add it on. + if ($order[$lastindex] != 0) { + $order[] = 0; + $lastindex++; + } echo "