-
Bug
-
Resolution: Fixed
-
Minor
-
4.5
-
MOODLE_405_STABLE
-
MOODLE_405_STABLE
-
MDL-83008-main -
-
HQ 2024 Sprint I3.2 Moppies
Subsections use a module called mod_subsection as base. This allows the teacher to combine subsections with any other section activity. The mod_subsection is a bit special because it does not have completion, view URL or any other typical things from an activity.
Teachers are not able to define completion rules for the subsection instances. However, the "Bulk edit activity completion" page still displays subsections as an activity with editable completion.
Steps to reproduce:
- Enable Subsection plugin
- Create a course with completion tracking
- Crerate some subsection and some activities
- Go to "Course completion -> Bulk edit activity completion"
- Expected: subsection activities should not be editabler
- What happens: subsection are displayed as any other activity and can be edited.
Technical shaping
The list of activities is calculates in "core_completion\manager::get_activities". However, there is a specific method to validate if the user can edit the completion "core_completion\manager::can_edit_bulk_completion". The patch can focus on this method.
The most logical approach should be adding something like:
if ($cm) { |
if (!plugin_supports('mod', $module->modname, FEATURE_COMPLETION, true)) { |
return false; |
}
|
return $cm->uservisible && has_capability('moodle/course:manageactivities', $cm->context); |
}
|
Somewhere on the can_edit_bulk_completion.
This will introduce the long-needed FEATURE_COMPLETION, which entirely disables completion on a module if it is false (the default will be true). However, for now, the new feature will be applied only here. Any necessary follow-up issues will be created to add feature checks in the code.
- blocks
-
MDL-83009 Bulk activity completion edit should represent subsections in the correct position
-
- Open
-
-
MDL-83027 Make FEATURE_COMPLETION consistent
-
- Open
-
- Discovered while testing
-
MDL-82983 Subsection shouln't appear in the Default completion forms
-
- Closed
-
- is blocked by
-
MDL-82983 Subsection shouln't appear in the Default completion forms
-
- Closed
-