mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-42528 Activity Completion: DnD upload should obey default setting
Make activities created by drad and drop obey Default completion tracking setting.
This commit is contained in:
parent
129ceb5849
commit
ac1a29755e
@ -599,6 +599,8 @@ class dndupload_ajax_processor {
|
||||
* Create the coursemodule to hold the file/content that has been uploaded
|
||||
*/
|
||||
protected function create_course_module() {
|
||||
global $CFG;
|
||||
|
||||
if (!course_allowed_module($this->course, $this->module->name)) {
|
||||
throw new coding_exception("The module {$this->module->name} is not allowed to be added to this course");
|
||||
}
|
||||
@ -616,7 +618,7 @@ class dndupload_ajax_processor {
|
||||
// Set the correct default for completion tracking.
|
||||
$this->cm->completion = COMPLETION_TRACKING_NONE;
|
||||
$completion = new completion_info($this->course);
|
||||
if ($completion->is_enabled()) {
|
||||
if ($completion->is_enabled() && $CFG->completiondefault) {
|
||||
if (plugin_supports('mod', $this->cm->modulename, FEATURE_MODEDIT_DEFAULT_COMPLETION, true)) {
|
||||
$this->cm->completion = COMPLETION_TRACKING_MANUAL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user