MDL-10239:
authorthepurpleblob <thepurpleblob>
Thu, 26 Jul 2007 15:08:16 +0000 (15:08 +0000)
committerthepurpleblob <thepurpleblob>
Thu, 26 Jul 2007 15:08:16 +0000 (15:08 +0000)
Improper check for correct answer in true/false questions

question/format/blackboard_6/format.php

index 0cb6cbdeb8eeebd6e9d6811ed24cc415ff167aaa..10b65b8bf96f396828c8262ecef2b07590e09c30 100644 (file)
@@ -558,9 +558,10 @@ function process_tf($quest, &$questions) {
 
     $question->qtype = TRUEFALSE;
     $question->single = 1; // Only one answer is allowed
-
-    // first choice is true, second is false.
-    if ($quest->responses[0]->fraction == 1) {
+    // 0th [response] is the correct answer.
+    $responses = $quest->responses;
+    $correctresponse = $responses[0]->ident[0]['varequal'][0]['#'];
+    if ($correctresponse != 'false') {
         $correct = true;    
     }
     else {