Skip to content

Commit

Permalink
MDL-75423 gradereport_singleview: Fix group navigation for grade mode
Browse files Browse the repository at this point in the history
When we change a group page should redirect to a user selection.
  • Loading branch information
ilyatregubov authored and Mihail Geshoski committed Nov 10, 2022
1 parent 6ae4e00 commit 8d81f8c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions grade/report/singleview/classes/report/singleview.php
Expand Up @@ -102,6 +102,10 @@ public function __construct(
// The setup_group method is used to validate group mode and permissions and define the currentgroup value.
$this->setup_groups();

if (($itemtype !== 'grade') && ($itemtype !== 'user')) {
$itemid = null;
}

$this->setup_item_selector($itemtype, $itemid);

$screenclass = "\\gradereport_singleview\\local\\screen\\${itemtype}";
Expand Down Expand Up @@ -138,6 +142,11 @@ protected static function groups_course_menu(stdClass $course, moodle_url $urlro
global $PAGE;

$renderer = $PAGE->get_renderer('core_grades');
$params = $urlroot->params();
if ($params['item'] == 'user') {
$params['item'] = 'user_select';
$urlroot->params($params);
}
return $renderer->group_selector($course, $urlroot->out());
}

Expand Down

0 comments on commit 8d81f8c

Please sign in to comment.