]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17779
authorthepurpleblob <thepurpleblob>
Mon, 5 Jan 2009 15:23:10 +0000 (15:23 +0000)
committerthepurpleblob <thepurpleblob>
Mon, 5 Jan 2009 15:23:10 +0000 (15:23 +0000)
Add simple check that question at least has questiontext before allowing it.

question/format/hotpot/format.php

index d3a4056b90181eabddb91f8a7504ac510873ff2b..efc708c1d2bed3105845c63d21f8834de1c74d69 100644 (file)
@@ -445,7 +445,10 @@ class qformat_hotpot extends qformat_default {
                         $question->fraction[$aa] = 1;
                     }
                 }
-                $questions[] = $question;
+                // add a sanity check for empty questions, see MDL-17779
+                if (!empty($question->questiontext)) {
+                    $questions[] = $question;
+                }
                 $q++;
             }
             $x++;