Skip to content

Commit

Permalink
Fixes #808. Allow taking of attendance for non-participation groups.
Browse files Browse the repository at this point in the history
  • Loading branch information
micaherne committed Feb 3, 2025
1 parent bec4095 commit 37a8927
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion take.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
$att = new mod_attendance_structure($att, $cm, $course, $PAGE->context, $pageparams);

$allowedgroups = groups_get_activity_allowed_groups($cm);
if (!empty($pageparams->grouptype) && !array_key_exists($pageparams->grouptype, $allowedgroups)) {
$accessallgroups = has_capability('moodle/site:accessallgroups', $context);
if (!$accessallgroups && !empty($pageparams->grouptype) && !array_key_exists($pageparams->grouptype, $allowedgroups)) {
$group = groups_get_group($pageparams->grouptype);
throw new moodle_exception('cannottakeforgroup', 'attendance', '', $group->name);
}
Expand Down

0 comments on commit 37a8927

Please sign in to comment.