]> git.mjollnir.org Git - moodle.git/commitdiff
Bug in export of multichoice-multianswer questions fixed.
authorthepurpleblob <thepurpleblob>
Thu, 9 Dec 2004 16:18:23 +0000 (16:18 +0000)
committerthepurpleblob <thepurpleblob>
Thu, 9 Dec 2004 16:18:23 +0000 (16:18 +0000)
Thanks to Nguyen Tuan Anh for spotting this and providing the fix!

mod/quiz/format/gift/format.php

index 2835d42276ea96e6613a19c3d86fd83be4476a10..c4258aae129f8779a74e1b37503a85ffd5a12273 100755 (executable)
@@ -470,9 +470,13 @@ function writequestion( $question ) {
             if ($answer->fraction==1) {
                 $answertext = '=';
             }
-            else {
+            elseif ($answer->fraction==0) {
                 $answertext = '~';
             }
+            else {
+              $export_weight = $answer->fraction*100;
+              $answertext = "~%$export_weight%";
+            }
             $expout .= "\t".$answertext.$answer->answer;
             if ($answer->feedback!="") {
                 $expout .= "#".$answer->feedback;