Project: moodle
Issue MDL-43274: Prevent course logs from being deleted when course is reset
We have a scenario: {quote} A number of course activities disappeared, and there are no logs at all in the class from before the 22nd November. {quote} where the most plausible explanation is that: {quote} The activites were deleted and (only) the course logs reset {quote} From my reading of the {{reset_course_userdata()}} function the logs from mdl_log are *hard* deleted, using the {{$DB->delete_records()}} function. This makes trying to answer what actually happened very difficult from a forensic position. It would be preferable if either the log table rows were treated by Moodle as being immutable or if the reset function did something else. This may be an issue specific to us since we have a centralised service and we have to be able to explain to our teachers what it is they may have done.
Story points: 8