]> git.mjollnir.org Git - moodle.git/commitdiff
Some fixes, after some testing
authormoodler <moodler>
Wed, 21 May 2003 06:10:43 +0000 (06:10 +0000)
committermoodler <moodler>
Wed, 21 May 2003 06:10:43 +0000 (06:10 +0000)
mod/quiz/format/missingword.php

index bf8f03c6ab09db6d7573fdf93122c43655af08d0..a3ca38f3d8a9edf09e89bd130eeeebab3062bce9 100644 (file)
@@ -55,9 +55,12 @@ class quiz_file_format extends quiz_default_format {
 
 
         /// Parse the answers
-        $answers = str_replace("=", "~=", $answertext);
+        $answertext = str_replace("=", "~=", $answertext);
         $answers = explode("~", $answertext);
-        if (empty(trim($answers[0]))) {
+        if (isset($answers[0])) {
+            $answers[0] = trim($answers[0]);
+        }
+        if (empty($answers[0])) {
             array_shift($answers);
         }