Merge branch 'MDL-79191-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE

This commit is contained in:
Andrew Nicols 2023-09-05 10:33:40 +08:00
commit d3bb9121fd
No known key found for this signature in database
GPG Key ID: 6D1E3157C8CFBF14
2 changed files with 5 additions and 5 deletions

View File

@ -226,11 +226,11 @@ class completion extends base {
LEFT JOIN {grade_grades} {$grade}
ON ({$user}.id = {$grade}.userid AND {$gradeitem}.id = {$grade}.itemid)
")
->set_type(column::TYPE_INTEGER)
->set_type(column::TYPE_FLOAT)
->add_fields("{$grade}.finalgrade")
->set_is_sortable(true)
->add_callback(function ($value) {
if (!$value) {
->add_callback(function(?float $value): string {
if ($value === null) {
return '';
}
return format_float($value, 2);

View File

@ -80,7 +80,7 @@ class participants_test extends core_reportbuilder_testcase {
// Update final grade for the user.
$courseitem = grade_item::fetch_course_item($course->id);
$courseitem->update_final_grade($user1->id, 80);
$courseitem->update_final_grade($user1->id, 42.5);
// Set some last access value for the user in the course.
$DB->insert_record('user_lastaccess',
@ -152,7 +152,7 @@ class participants_test extends core_reportbuilder_testcase {
'', // Reagreggate.
'2', // Days taking course.
'2', // Days until completion.
'80.00', // Grade.
'42.50', // Grade.
], array_values($content[0]));
}