MDL-74533 core_completion: Update using new grade pass for completion

This commit is contained in:
hieuvu
2022-05-23 15:14:12 +07:00
parent 941a29925e
commit 5cfaa18cad
3 changed files with 253 additions and 10 deletions
+1 -2
View File
@@ -678,6 +678,7 @@ function update_moduleinfo($cm, $moduleinfo, $course, $mform = null) {
if (core_tag_tag::is_enabled('core', 'course_modules') && isset($moduleinfo->tags)) {
core_tag_tag::set_item_tags('core', 'course_modules', $moduleinfo->coursemodule, $modcontext, $moduleinfo->tags);
}
$moduleinfo = edit_module_post_actions($moduleinfo, $course);
// Now that module is fully updated, also update completion data if required.
// (this will wipe all user completion data and recalculate it)
@@ -691,8 +692,6 @@ function update_moduleinfo($cm, $moduleinfo, $course, $mform = null) {
$cm->name = $moduleinfo->name;
\core\event\course_module_updated::create_from_cm($cm, $modcontext)->trigger();
$moduleinfo = edit_module_post_actions($moduleinfo, $course);
return array($cm, $moduleinfo);
}