From c7e61fba0a8f95878c1c4c5f63c67fb13b24611d Mon Sep 17 00:00:00 2001 From: Davo Smith Date: Tue, 18 Dec 2012 20:46:26 +0000 Subject: [PATCH] MDL-35887 course dndupload - correct default used for completion tracking when resources created by drag and drop --- course/dnduploadlib.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/course/dnduploadlib.php b/course/dnduploadlib.php index 6fb00b02f89..21dc7a790d2 100644 --- a/course/dnduploadlib.php +++ b/course/dnduploadlib.php @@ -555,6 +555,15 @@ class dndupload_ajax_processor { $this->cm->groupmode = $this->course->groupmode; $this->cm->groupingid = $this->course->defaultgroupingid; + // Set the correct default for completion tracking. + $this->cm->completion = COMPLETION_TRACKING_NONE; + $completion = new completion_info($this->course); + if ($completion->is_enabled()) { + if (plugin_supports('mod', $this->cm->modulename, FEATURE_MODEDIT_DEFAULT_COMPLETION, true)) { + $this->cm->completion = COMPLETION_TRACKING_MANUAL; + } + } + if (!$this->cm->id = add_course_module($this->cm)) { throw new coding_exception("Unable to create the course module"); }