From 13e88db4a2955182f032d856621b9b9abcc293b7 Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Mon, 20 Aug 2007 10:36:30 +0000 Subject: [PATCH] MDL-10819: GIFT now exports grade fractions for numeric questions Merged from STABLE_18 --- question/format/gift/format.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/question/format/gift/format.php b/question/format/gift/format.php index a9844bb75a..b6a722e0eb 100755 --- a/question/format/gift/format.php +++ b/question/format/gift/format.php @@ -616,7 +616,12 @@ function writequestion( $question ) { $expout .= "::".$this->repchar($question->name)."::".$tfname.$this->repchar( $question->questiontext, $textformat )."{#\n"; foreach ($question->options->answers as $answer) { if ($answer->answer != '') { - $expout .= "\t=".$answer->answer.":".(float)$answer->tolerance."#".$this->repchar( $answer->feedback )."\n"; + $percentage = ''; + if ($answer->fraction < 1) { + $pval = $answer->fraction * 100; + $percentage = "%$pval%"; + } + $expout .= "\t=$percentage".$answer->answer.":".(float)$answer->tolerance."#".$this->repchar( $answer->feedback )."\n"; } else { $expout .= "\t~#".$this->repchar( $answer->feedback )."\n"; } -- 2.39.5