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 26, 2023
1 parent 4e632b7 commit c77f996
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 @@ -75,7 +75,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 @@ -85,7 +85,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 c77f996

Please sign in to comment.