mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 16:40:07 +01:00
Merge branch 'master_MDL-46172' of https://github.com/greg-or/moodle-mod_assign
This commit is contained in:
commit
d5265ac28e
@ -1967,9 +1967,10 @@ class assign {
|
||||
*
|
||||
* @param int $groupid The id of the group whose members we want or 0 for the default group
|
||||
* @param bool $onlyids Whether to retrieve only the user id's
|
||||
* @param bool $excludesuspended Whether to exclude suspended users
|
||||
* @return array The users (possibly id's only)
|
||||
*/
|
||||
public function get_submission_group_members($groupid, $onlyids) {
|
||||
public function get_submission_group_members($groupid, $onlyids, $excludesuspended = false) {
|
||||
$members = array();
|
||||
if ($groupid != 0) {
|
||||
if ($onlyids) {
|
||||
@ -1991,7 +1992,7 @@ class assign {
|
||||
}
|
||||
}
|
||||
// Exclude suspended users, if user can't see them.
|
||||
if (!has_capability('moodle/course:viewsuspendedusers', $this->context)) {
|
||||
if ($excludesuspended || !has_capability('moodle/course:viewsuspendedusers', $this->context)) {
|
||||
foreach ($members as $key => $member) {
|
||||
if (!$this->is_active_user($member->id)) {
|
||||
unset($members[$key]);
|
||||
@ -6673,7 +6674,7 @@ class assign {
|
||||
$groupid = $group->id;
|
||||
}
|
||||
}
|
||||
$members = $this->get_submission_group_members($groupid, true);
|
||||
$members = $this->get_submission_group_members($groupid, true, $this->show_only_active_users());
|
||||
foreach ($members as $member) {
|
||||
// User may exist in multple groups (which should put them in the default group).
|
||||
$this->apply_grade_to_user($data, $member->id, $data->attemptnumber);
|
||||
|
Loading…
x
Reference in New Issue
Block a user