Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-35887 course dndupload - correct default used for completion trac…

…king when resources created by drag and drop
  • Loading branch information...
commit 318b859ac862ad6c382b3e029fc895d4bcb7d027 1 parent d9402ac
@davosmith davosmith authored samhemelryk committed
Showing with 9 additions and 0 deletions.
  1. +9 −0 course/dnduploadlib.php
View
9 course/dnduploadlib.php
@@ -555,6 +555,15 @@ protected function create_course_module() {
$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");
}
Please sign in to comment.
Something went wrong with that request. Please try again.