From df4fe0009bb7abcd6a5c6b2d2db8421294c2e070 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Wed, 29 Dec 2004 07:21:55 +0000 Subject: [PATCH] avoids error when exporting 0 questions --- mod/quiz/format.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mod/quiz/format.php b/mod/quiz/format.php index 131158d647..6b6d1f0495 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) -- 2.39.5