Skip to content
Browse files

A robustness check when dealing with unexpected question data.

Shouldn't ever be needed, but I can't yet see what is causing the
situation I'm seeing on a couple of sites where a question doesn't
have a type, and this solves it neatly.
  • Loading branch information...
1 parent 6f6109d commit 645ed2b68863b3f8c800a1432c707572c4678c0f moodler committed Nov 10, 2004
Showing with 4 additions and 0 deletions.
  1. +4 −0 mod/quiz/lib.php
View
4 mod/quiz/lib.php
@@ -989,6 +989,10 @@ function quiz_print_quiz_questions($quiz, $questions,
foreach ($questions as $question) {
+ if (empty($question->qtype)) { // Just for robustness
+ continue;
+ }
+
$questionorder[] = $question->id;
if ($results && isset($results->details[$question->id])) {

0 comments on commit 645ed2b

Please sign in to comment.
Something went wrong with that request. Please try again.