diff --git a/grade/report/singleview/classes/local/screen/grade.php b/grade/report/singleview/classes/local/screen/grade.php index 2739f0f5896..51346d1b99a 100644 --- a/grade/report/singleview/classes/local/screen/grade.php +++ b/grade/report/singleview/classes/local/screen/grade.php @@ -123,9 +123,13 @@ class grade extends tablelike implements selectable_items, filterable_items { public function init($selfitemisempty = false) { $roleids = explode(',', get_config('moodle', 'gradebookroles')); - $this->items = get_role_users( - $roleids, $this->context, false, '', - 'u.lastname, u.firstname', null, $this->groupid); + $this->items = array(); + foreach ($roleids as $roleid) { + // Keeping the first user appearance. + $this->items = $this->items + get_role_users( + $roleid, $this->context, false, '', + 'u.lastname, u.firstname', null, $this->groupid); + } $this->totalitemcount = count_role_users($roleids, $this->context); diff --git a/grade/report/singleview/classes/local/screen/select.php b/grade/report/singleview/classes/local/screen/select.php index 0719fd07ad0..c90d9ba0137 100644 --- a/grade/report/singleview/classes/local/screen/select.php +++ b/grade/report/singleview/classes/local/screen/select.php @@ -48,11 +48,15 @@ class select extends screen { $roleids = explode(',', get_config('moodle', 'gradebookroles')); - $this->items = get_role_users( - $roleids, $this->context, false, '', - 'u.id, u.lastname, u.firstname', null, $this->groupid, - $this->perpage * $this->page, $this->perpage - ); + $this->items = array(); + foreach ($roleids as $roleid) { + // Keeping the first user appearance. + $this->items = $this->items + get_role_users( + $roleid, $this->context, false, '', + 'u.id, u.lastname, u.firstname', null, $this->groupid, + $this->perpage * $this->page, $this->perpage + ); + } $this->item = $DB->get_record('course', array('id' => $this->courseid)); }