]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed import of SHORTANSWER questions
authormoodler <moodler>
Mon, 23 Aug 2004 13:04:50 +0000 (13:04 +0000)
committermoodler <moodler>
Mon, 23 Aug 2004 13:04:50 +0000 (13:04 +0000)
mod/quiz/format/webct/format.php

index e4c3d67ac36e43d771166d3fcffa93f1f5963e3a..b0a927f19bbfc84969f03d007bcfc45580fef5ec 100644 (file)
@@ -523,17 +523,17 @@ class quiz_file_format extends quiz_default_format {
                 continue;
             }
 
-            if (eregi("^:ANSWER([0-9]+):([0-9\.]+)",$line,$webct_options)) {
-                $answertext="";                 // Start gathering next lines
+            if (eregi("^:ANSWER([0-9]+):([^:]+):([0-9\.]+):(.*)",$line,$webct_options)) {      /// SHORTANSWER
                 $currentchoice=$webct_options[1];
-                $question->fraction[$currentchoice]=($webct_options[2]/100);
+                $answertext=$webct_options[2];            // Start gathering next lines
+                $question->fraction[$currentchoice]=($webct_options[3]/100);
                 continue;
             }
 
-            if (eregi("^:ANSWER([0-9]+):([^:]+):([0-9\.]+):(.*)",$line,$webct_options)) {      /// SHORTANSWER
+            if (eregi("^:ANSWER([0-9]+):([0-9\.]+)",$line,$webct_options)) {
+                $answertext="";                 // Start gathering next lines
                 $currentchoice=$webct_options[1];
-                $answertext=$webct_options[2];            // Start gathering next lines
-                $question->fraction[$currentchoice]=($webct_options[3]/100);
+                $question->fraction[$currentchoice]=($webct_options[2]/100);
                 continue;
             }