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

Course completion cron code sometimes needs to run twice to mark students as complete

XMLWordPrintable

    • MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_31_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE

      The course completion cron code sometimes has to run twice before students are marked as complete in a course.

      I think this is because:

      • as part of completion_cron_mark_started() and maybe completion_cron_criteria(), records get inserted into course_completions with a reaggregate value of time()
      • in completion_cron_completions(), only course completions with a reaggregate less than the the value of time() are checked

      For small sites its possible for records that should be processed in completion_cron_completion() to get missed.

      The function completion_cron_completions should check for records that have a reaggregate value less than *or equal* to the current value of time().

      Edited (2022): Side note, don't forget to look for "MDL-33320" in code when fixing this because there are a bunch of "hacks" related with PHPUnit mainly that may need to be removed too.

            Unassigned Unassigned
            nmares Nathan Mares
            Votes:
            13 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:

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