]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8563
authorthepurpleblob <thepurpleblob>
Wed, 21 Feb 2007 14:20:46 +0000 (14:20 +0000)
committerthepurpleblob <thepurpleblob>
Wed, 21 Feb 2007 14:20:46 +0000 (14:20 +0000)
$question->answer was swapped for $question->correctanswer in questiontype
for some reason! Compensated for in format type.

question/format/gift/format.php
question/format/xml/format.php

index e719ab84c6a3bb8b2cbc98654ee90943ec208828..e2c90bcb54bd4fe9d0bb080ee39e44772556ebba 100755 (executable)
@@ -363,8 +363,8 @@ class qformat_gift extends qformat_default {
                     $question->feedbacktrue = $feedback['wrong'];
                 }
 
-                //$question->defaultgrade = 1;
-                //$question->image = "";   // No images with this format
+                $question->correctanswer = $question->answer;
+
                 return $question;
                 break;
                 
index cf091ab6439df93838745f659b9b83567f83ebee..de91b20bd5e3b5bb66f119d8130fc59379d64a50 100755 (executable)
@@ -232,9 +232,11 @@ class qformat_xml extends qformat_default {
             } 
             if ($answertext == 'true') {
                 $qo->answer = ($answer['@']['fraction'] == 100);
+                $qo->correctanswer = $qo->answer;
                 $qo->feedbacktrue = $feedback;
             } else {
                 $qo->answer = ($answer['@']['fraction'] != 100);
+                $qo->correctanswer = $qo->answer;
                 $qo->feedbackfalse = $feedback;
             }
             $first = false;