Skip to content

Commit

Permalink
A robustness check when dealing with unexpected question data.
Browse files Browse the repository at this point in the history
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
moodler committed Nov 10, 2004
1 parent 6f6109d commit 645ed2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mod/quiz/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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])) {
Expand Down

0 comments on commit 645ed2b

Please sign in to comment.