]> git.mjollnir.org Git - moodle.git/commitdiff
selliott - Fixed mixup in feedback for true/false questions
authorselliott <selliott>
Fri, 8 Aug 2003 18:06:41 +0000 (18:06 +0000)
committerselliott <selliott>
Fri, 8 Aug 2003 18:06:41 +0000 (18:06 +0000)
mod/quiz/format/blackboard.php

index 26cf627d82c53c326e2b8eb59c55148939a46f10..66f72efb2f2c99af5c0d7a758dce421d7af178da 100644 (file)
@@ -96,14 +96,15 @@ function process_tf($xml, &$questions) {
         // first choice is true, second is false.
         $id = $choices[0]["@"]["id"];
 
-        $question->feedbacktrue = addslashes(trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
-        $question->feedbackfalse = addslashes(trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
-
-        if (strcmp($id, $correct_answer) == 0)  // true is correct
+        if (strcmp($id, $correct_answer) == 0) {  // true is correct
             $question->answer = 1;
-        else   // false is correct
+            $question->feedbacktrue = addslashes(trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
+            $question->feedbackfalse = addslashes(trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
+        } else {  // false is correct
             $question->answer = 0;
-
+            $question->feedbacktrue = addslashes(trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_INCORRECT"][0]["#"]));
+            $question->feedbackfalse = addslashes(trim($thisquestion["#"]["GRADABLE"][0]["#"]["FEEDBACK_WHEN_CORRECT"][0]["#"]));
+        }
         $questions[] = $question;
       }
 }