That was a helpful thread, thanks for finding it. And gave me a few clues. So did asking ChatGPT, to be honest.
So, as I understand it, the reason why you cannot easily undo a course completion status once a student in a course is marked as "complete" for the whole course is because it could create inconsistencies inside a course of HOW course completion was achieved. But this doesn't entirely make sense to me since it seems like the completion criteria could be "checked" and the course completion status validated via a Chron job. In fact, that's what I thought was the purpose of "\core\task\completion_regular_task" But I've checked, removing one of the conditions for course completion does NOT cause the course completion to reset for an individual student.
So I aware of an approach where you hack the database by running an SQL query something like this:
DELETE FROM mdl_course_completions
WHERE userid = 12345
AND course = 678
My questions might be
- Would this work or would the cron job (\core\task\completion_regular_task) reset the course to complete, anyway, if all the activities and creteria are still set to true
- Is it a problem that this might create "orphaned criteria" where all the criteria show (to the student/teacher) as completed by the status for the whole course is still "not completed"
- Is this likely to create problems with completion reports, progress dashbobards, badges, etc.
- is this likely to create problematic inconsistencies with other tables like mdl_logstore_standard_log
So given that there is a high probability that directly editing the table could have bad consequences... I wonder if anyone has any other good ideas for how to reset just one student's course completion status?
This plugin here, incidentally, is CLOSE to what I'm talking about, but actually is somewhat overkill! https://moodle.org/plugins/local_recompletion Still, I'm going to reach out to Dan Marsden who maintains that plugin for his thoughts.
Anyway, I'm interested to hear more thoughts about this!
Tay Moss
----------
https://churchx.ca
Moodle 4.1 + "Sophia" Catalogue system