Moodle
  1. Moodle
  2. MDL-31914

Deleting an activity/resource with course completion enabled doesn't remove it's entry in course_completion_criteria

    Details

    • Testing Instructions:
      Hide
      • Enable 'Completion Tracking' in the Site Administration -> Advanced Features page
      • In a course, choose Edit Settings, and under 'Student Progress' change Completion tracking to Enabled and save changed
      • Create a new activity - I created a page for simplicity
        • set Completion tracking to 'Show activity as complete when conditions are met'
        • tick the 'Require view' checkbox
        • save changes
      • Create a second new activity - I created a page for simplicity
        • set Completion tracking to 'Show activity as complete when conditions are met'
        • tick the 'Require view' checkbox
        • save changes
      • Open Settings -> Course Administration -> Completion Tracking
        • Under 'Activites Completed' tick the checkboxes for the new activities you created
        • save changes
      • Open Reports -> Course Completion
        • Confirm that there are no errors
        • You may wish to keep this page open
      • Back in the course, remove one of the activities
      • Refresh the Course Completion report
        • Confirm that there are no errors

      The previous result was that errors would be displayed in the course completion report.
      You can also verify that the database entry has been removed from the course_completion_criteria table

      Show
      Enable 'Completion Tracking' in the Site Administration -> Advanced Features page In a course, choose Edit Settings, and under 'Student Progress' change Completion tracking to Enabled and save changed Create a new activity - I created a page for simplicity set Completion tracking to 'Show activity as complete when conditions are met' tick the 'Require view' checkbox save changes Create a second new activity - I created a page for simplicity set Completion tracking to 'Show activity as complete when conditions are met' tick the 'Require view' checkbox save changes Open Settings -> Course Administration -> Completion Tracking Under 'Activites Completed' tick the checkboxes for the new activities you created save changes Open Reports -> Course Completion Confirm that there are no errors You may wish to keep this page open Back in the course, remove one of the activities Refresh the Course Completion report Confirm that there are no errors The previous result was that errors would be displayed in the course completion report. You can also verify that the database entry has been removed from the course_completion_criteria table
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      master_MDL-31914
    • Rank:
      38563

      Description

      With course completion enabled and one or more activities tracked under course completion, the criteria for course completion are stored in the course_completion_criteria table.
      If an activity is removed, then its entry in this table is never removed.

      This doesn't cause an issue on most pages, but on the course completion report, this throws a number of errors and causes broken rendering of the course completion page.

      I suggest that this fix:

      1. remove completion criteria when removing an activity/resource;
      2. tidies up existing 'broken' data; and
      3. improves checking on the report.

        Issue Links

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: