mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
course MDL-23701: Fixed order of deleting entire course to delete grades before course-modules, avoiding dependency problem
This commit is contained in:
parent
a26246eac2
commit
fce37b254e
@ -4015,6 +4015,12 @@ function remove_course_contents($courseid, $showfeedback=true) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Remove all data from gradebook - this needs to be done before course modules
|
||||
/// because while deleting this information, the system may need to reference
|
||||
/// the course modules that own the grades.
|
||||
remove_course_grades($courseid, $showfeedback);
|
||||
remove_grade_letters($context, $showfeedback);
|
||||
|
||||
/// Delete every instance of every module
|
||||
|
||||
if ($allmods = $DB->get_records('modules') ) {
|
||||
@ -4088,10 +4094,6 @@ function remove_course_contents($courseid, $showfeedback=true) {
|
||||
/// Delete questions and question categories
|
||||
question_delete_course($course, $showfeedback);
|
||||
|
||||
/// Remove all data from gradebook
|
||||
remove_course_grades($courseid, $showfeedback);
|
||||
remove_grade_letters($context, $showfeedback);
|
||||
|
||||
/// Delete course tags
|
||||
require_once($CFG->dirroot.'/tag/coursetagslib.php');
|
||||
coursetag_delete_course_tags($course->id, $showfeedback);
|
||||
|
Loading…
x
Reference in New Issue
Block a user