Skip to content

Commit

Permalink
MDL-77546 gradereport_singleview: Fix item order in grade item selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihail Geshoski committed Apr 27, 2023
1 parent b2d0712 commit f90a559
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions grade/report/singleview/classes/external/singleview.php
Expand Up @@ -80,7 +80,7 @@ protected static function get_grade_items_for_search_widget(int $courseid): arra
$coursecontext = context_course::instance($params['courseid']);
parent::validate_context($coursecontext);

$gtree = new grade_tree($params['courseid'], false, false, null, !$CFG->enableoutcomes);
$gtree = new grade_tree($params['courseid'], false, true, null, !$CFG->enableoutcomes);
$gradeableitems = $gtree->get_items();

$gradeitems = array_map(function ($gradeitem) use ($PAGE, $USER, $params) {
Expand All @@ -98,7 +98,6 @@ protected static function get_grade_items_for_search_widget(int $courseid): arra

return $item;
}, $gradeableitems);
sort($gradeitems);

return [
'gradeitems' => $gradeitems,
Expand Down

0 comments on commit f90a559

Please sign in to comment.