-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.4.3, 4.5.1
-
MOODLE_404_STABLE, MOODLE_405_STABLE
Summary:
When using Condition: Unenrolment as a course completion criterion, no course completion record is ever generated when the user is unenrolled.
Steps to replicate:
- Create a new course
- Enrol a Student user into the course
- In More>Course completion, tick 'Condition: Unenrolment', save changes
- Unenrol the student user from the course
- Force (or wait) for the \core\task\completion_regular_task scheduled task to run
- Force (or wait) for the admin cron to run
- Run a query to check the mdl_course_completions table for the user/course e.g.
SELECT * from mdl_course_completions
WHERE course=<enter courseid of test course>
Observed behaviour:
There is no record in mdl_course_completions for the user who was unenrolled
Expected behaviour:
There is a completion record with the appropriate timestamp for the user who was unenrolled
Further discussion:
- This can also be tested by re-enrolling the user in the course after the test, which would (for any other criteria at least) restore the completion data that can then be checked in Reports>Course completion. I found SQL is a bit more objective, as you can definitively see that no record is ever generated
- I am unsure what the use case for this criterion is, given that if a user should only receive a completion when they are unenrolled, this (assuming it was working) could never be viewed via Reports>Course completion, which will only show enrolled users.
- The only way to retrieve this data (once again, assuming it was there) would be via an SQL report, or possibly by re-enrolling the user (assuming the criteria is not re-verified to be 'incomplete' once the user is once again re-enrolled)
- Given these caveats, it may be necessary to review in general how this condition should function and how the data (once this issue is fixed) should be displayed via the UI to render it more functional