]> git.mjollnir.org Git - moodle.git/commitdiff
avoids error when exporting 0 questions
authorgustav_delius <gustav_delius>
Wed, 29 Dec 2004 07:21:55 +0000 (07:21 +0000)
committergustav_delius <gustav_delius>
Wed, 29 Dec 2004 07:21:55 +0000 (07:21 +0000)
mod/quiz/format.php

index 131158d64771f5a3b5bcb9b1772a78537cb7742e..6b6d1f0495398d91ede67e04769963639d1c1f42 100644 (file)
@@ -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)