by Aaron Batty.
UPDATE!
Not crazymaking!
It worked with another class that I had tried last night. Perhaps the courses I was working with had been reset, but unenrolled user accounts still hang around in the record? At this point, it simply wouldn't surprise me... Perhaps they hang around to preserve grade history?
I.e.: It might be working now. Preserving the below for reference.
===============================================================
Okay, here's where we stand now:
- I went into the mdl_user table and deleted all the "deleted=1" rows.
- I then tried restoring a course that had failed last night to restore with users intact over itself (not a new course). ⇒ It kept the user settings from last night; just the teacher user I had enrolled. However, it still created all the new user accounts. It just didn't preserve their enrollments in the class.
- I then tried deleting the previously-restored course and bringing it back in fresh ⇒ Same behavior.
- I then tried restoring the course to a different category with a different name to try to trick Moodle into actually treating it as a new course. ⇒ Same behavior.
This is now officially driving me mad. How does Moodle know that this course has been restored before, and that I had manually enrolled the teacher? Looking at the database (mdl_course), it actually does seem to delete courses when you ask, rather than bizarrely flagging them "deleted" and letting them sit there for literally 10 years like I just recently discovered is the case with users.
This is truly crazymaking.