Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-31095 quiz: fix bug in quiz::has_questions.

  • Loading branch information...
commit d4b150dd1311f8656b37d0bce1c822a81ca9ae51 1 parent c1dc3a5
@timhunt timhunt authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 mod/quiz/attemptlib.php
View
7 mod/quiz/attemptlib.php
@@ -90,7 +90,12 @@ public function __construct($quiz, $cm, $course, $getcontext = true) {
if ($getcontext && !empty($cm->id)) {
$this->context = get_context_instance(CONTEXT_MODULE, $cm->id);
}
- $this->questionids = explode(',', quiz_questions_in_quiz($this->quiz->questions));
+ $questionids = quiz_questions_in_quiz($this->quiz->questions);
+ if ($questionids) {
+ $this->questionids = explode(',', quiz_questions_in_quiz($this->quiz->questions));
+ } else {
+ $this->questionids = array(); // Which idiot made explode(',', '') = array('')?
+ }
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.