-
Improvement
-
Resolution: Fixed
-
Minor
-
3.9.16, 3.11.9, 4.0.3, 4.1, 4.2
-
MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
-
MOODLE_402_STABLE
-
MDL-75594-master -
Easy
-
A often requested feature is the ability to insert a new course module anywhere in a section not just at the end. This is especially important for trainers who update their courses very frequently.
As a first step I'd propose to add an option to the API for course module creation that supports a parameter that indicates, where in the section the module has to be created.
As the API already supports the parameter $beforemod in course_add_cm_to_section() it would be the easiest way to use this option to provide a consistent behavior:
Every course module id in the section can be used as a value of $beforemod here. The new module is inserted before $beforemod in the corresponding section. If it is not set, the new module is inserted at the end of the section.
If the course module in $beforemod is moved during creation of the module (maybe by another trainer, but that might be an edge case) there are two different options:
- If it is moved inside the section, the new module will be created before the (new) position of $beforemod.
- If it is moved outside the section, the new module will be created at the end of the section.
Adding the new option to the theme and the activity chooser is a separate issue (MDL-75596).
- blocks
-
MDL-75596 Adding new activities should be possible anywhere in a section
- Closed