diff --git a/mod/quiz/format.php b/mod/quiz/format.php index 131158d6477..6b6d1f04953 100644 --- a/mod/quiz/format.php +++ b/mod/quiz/format.php @@ -192,6 +192,9 @@ class quiz_default_format { $questions = get_questions_category( $this->category ); notify("Exporting ".count($questions)." questions."); + if (!count($questions)) { + return true; + } $count = 0; // results are first written into string (and then to a file)