MDL-27748 question: grade options should be localised.

question_bank::fraction_options should use format_float to display
decimal pionts correctly.
This commit is contained in:
Tim Hunt
2013-05-19 23:45:48 +01:00
parent e038687c55
commit 0377e4fbc9
+3 -2
View File
@@ -380,14 +380,15 @@ abstract class question_bank {
// The the positive grades in descending order.
foreach ($rawfractions as $fraction) {
$percentage = (100 * $fraction) . '%';
$percentage = format_float(100 * $fraction, 5, true, true) . '%';
self::$fractionoptions["$fraction"] = $percentage;
self::$fractionoptionsfull["$fraction"] = $percentage;
}
// The the negative grades in descending order.
foreach (array_reverse($rawfractions) as $fraction) {
self::$fractionoptionsfull['' . (-$fraction)] = (-100 * $fraction) . '%';
self::$fractionoptionsfull['' . (-$fraction)] =
format_float(-100 * $fraction, 5, true, true) . '%';
}
self::$fractionoptionsfull['-1.0'] = '-100%';