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

Course completion timeenrolled is not always set correctly

XMLWordPrintable

    • MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_310_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE
    • master-MDL-34332
    • Hide

      Test 1

      1. Run phpunit and make sure completion test pass

      Test 2

      1. Create a course and enable "Completion tracking"
      2. Enrol users and run cron
      3. Check timeenrolled field in course_completions table and user_enrolments table have same value in timeenrolled and timecreated.
      Show
      Test 1 Run phpunit and make sure completion test pass Test 2 Create a course and enable "Completion tracking" Enrol users and run cron Check timeenrolled field in course_completions table and user_enrolments table have same value in timeenrolled and timecreated.

      The logic around setting timeenrolled in course completion has a couple of issues.

      First, the cron uses the enrolments timecreated if it's higher than timeenrolled - this was to try work around the fact enrolment plugins might have a timeenrolled value of 0. Unfortunately this means that if an enrolment is created for the past the timecreated value will be higher and therefore completion will pick up the wrong date.

      Secondly, if the course_completions record is created between the user enrolling in the course and the first cron run, completion_completion::mark_inprogress() does not set the timeenrolled value and will be set at 0.

            Votes:
            2 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 11 minutes
                3h 11m

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