X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=blobdiff_plain;f=lib%2Faccesslib.php;h=d96d135d420b4520c8d0af4cf8cbfecb1256182c;hp=44793792c72b0164f25b2dec388443a2fcd3db51;hb=9e32368b2993b92400a1b17a58ca232144524b2a;hpb=c15b933c69fd1e7888362b423466064ba73d1b45 diff --git a/lib/accesslib.php b/lib/accesslib.php index 44793792c72..d96d135d420 100644 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -4919,6 +4919,10 @@ abstract class context extends stdClass { $fs = get_file_storage(); $fs->delete_area_files($this->_id); + // delete all advanced grading data attached to this context + require_once($CFG->dirroot.'/grade/grading/lib.php'); + grading_manager::delete_all_for_context($this->_id); + // now delete stuff from role related tables, role_unassign_all // and unenrol should be called earlier to do proper cleanup $DB->delete_records('role_assignments', array('contextid'=>$this->_id));