mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-63390 Quiz: Use lang rules to format quiz summark as a percentage
Part of MDL-62610
This commit is contained in:
parent
bef224c6e4
commit
24c28f3c9b
@ -327,7 +327,8 @@ function quiz_report_scale_summarks_as_percentage($rawmark, $quiz, $round = true
|
||||
if ($round) {
|
||||
$mark = quiz_format_grade($quiz, $mark);
|
||||
}
|
||||
return $mark . '%';
|
||||
|
||||
return get_string('percents', 'moodle', $mark);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,9 +66,9 @@ class mod_quiz_reportlib_testcase extends advanced_testcase {
|
||||
$quiz->sumgrades = 10;
|
||||
$quiz->decimalpoints = 2;
|
||||
|
||||
$this->assertEquals('12.34567%',
|
||||
$this->assertEquals('12.34567 %',
|
||||
quiz_report_scale_summarks_as_percentage(1.234567, $quiz, false));
|
||||
$this->assertEquals('12.35%',
|
||||
$this->assertEquals('12.35 %',
|
||||
quiz_report_scale_summarks_as_percentage(1.234567, $quiz, true));
|
||||
$this->assertEquals('-',
|
||||
quiz_report_scale_summarks_as_percentage('-', $quiz, true));
|
||||
|
Loading…
x
Reference in New Issue
Block a user