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:
@@ -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%';
|
||||
|
||||
Reference in New Issue
Block a user