if (has_capability('moodle/grade:viewall', $this->context)
and has_capability('moodle/site:accessallgroups', $this->context)
- and $COURSE->groupmode != NOGROUPS) { // TODO replace that last condition with proper check
+ and ($course_has_groups = true)) { // TODO replace that last condition with proper check
$html .= $this->print_toggle('groups', true);
}
if ($canviewhidden) {
$preferences['prefshow']['showaverages'] = $checkbox_default;
}
- if ($course->groupmode != NOGROUPS) {
- $preferences['prefshow']['showgroups'] = $checkbox_default;
- }
-
+ $preferences['prefshow']['showgroups'] = $checkbox_default;
$preferences['prefshow']['showlocks'] = $checkbox_default;
$preferences['prefrows'] = array(