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

Subsection completion should not be editable using bulk edit activity completion

XMLWordPrintable

    • 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:

      1. Enable Subsection plugin
      2. Create a course with completion tracking
      3. Crerate some subsection and some activities
      4. Go to "Course completion -> Bulk edit activity completion"
      5. Expected: subsection activities should not be editabler
      6. 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.

            tusefomal Ferran Recio
            tusefomal Ferran Recio
            Mikel Martín Corrales Mikel Martín Corrales
            Amaia Anabitarte Amaia Anabitarte
            CiBoT CiBoT
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 1 hour, 27 minutes
                2d 1h 27m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.