From a07fe4ba72de2f256b08dfda0b40ca31647ce4f0 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 23 Aug 2004 13:04:50 +0000 Subject: [PATCH] Fixed import of SHORTANSWER questions --- mod/quiz/format/webct/format.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mod/quiz/format/webct/format.php b/mod/quiz/format/webct/format.php index e4c3d67ac3..b0a927f19b 100644 --- a/mod/quiz/format/webct/format.php +++ b/mod/quiz/format/webct/format.php @@ -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; } -- 2.39.5