Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-75594

Change course module creation to support parameter for inserting modules at any place in the section

    XMLWordPrintable

Details

    Description

      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).

      Attachments

        Issue Links

          Activity

            People

              stefan.hanauska Stefan Hanauska
              stefan.hanauska Stefan Hanauska
              PhMemmel PhMemmel
              Amaia Anabitarte, Bas Brands, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona), Huong Nguyen, Barbara Ramiro, Bas Brands, Mathew May, David Woloszyn, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              14 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 minute
                  1m