MDL-58267 completion: allow to set default activity completion

Part of MDL-58138 epic
This commit is contained in:
Marina Glancy
2017-04-19 08:54:35 +08:00
committed by Jake Dallimore
parent 06cdda468a
commit 7f53e8aa22
42 changed files with 1125 additions and 407 deletions
+6
View File
@@ -760,6 +760,12 @@ function prepare_new_moduleinfo_data($course, $modulename, $section) {
$data->instance = '';
$data->coursemodule = '';
// Apply completion defaults.
$defaults = \core_completion\manager::get_default_completion($course, $module);
foreach ($defaults as $key => $value) {
$data->$key = $value;
}
if (plugin_supports('mod', $data->modulename, FEATURE_MOD_INTRO, true)) {
$draftid_editor = file_get_submitted_draft_itemid('introeditor');
file_prepare_draft_area($draftid_editor, null, null, null, null, array('subdirs'=>true));