MDL-53719 competency: Delete content upon course and cm delete/reset

This commit is contained in:
Frederic Massart 2016-04-11 18:21:11 +08:00
parent e0c2d7c02e
commit 56537316f6
6 changed files with 240 additions and 1 deletions

View file

@ -1770,6 +1770,9 @@ function course_delete_module($cmid) {
core_tag_tag::delete_instances('mod_' . $modulename, null, $modcontext->id);
core_tag_tag::remove_all_item_tags('core', 'course_modules', $cm->id);
// Notify the competency subsystem.
\core_competency\api::hook_course_module_deleted($cm);
// Delete the context.
context_helper::delete_instance(CONTEXT_MODULE, $cm->id);

View file

@ -48,7 +48,7 @@ class course_reset_form extends moodleform {
$mform->addElement('checkbox', 'reset_completion', get_string('deletecompletiondata', 'completion'));
$mform->addElement('checkbox', 'delete_blog_associations', get_string('deleteblogassociations', 'blog'));
$mform->addHelpButton('delete_blog_associations', 'deleteblogassociations', 'blog');
$mform->addElement('checkbox', 'reset_competency_ratings', get_string('deletecompetencyratings', 'core_competency'));
$mform->addElement('header', 'rolesheader', get_string('roles'));