diff --git a/completion/classes/manager.php b/completion/classes/manager.php index 01113760a38..8ee04b0f794 100644 --- a/completion/classes/manager.php +++ b/completion/classes/manager.php @@ -457,6 +457,7 @@ class manager { $completion = new \completion_info(get_fast_modinfo($course->id)->get_course()); if ($completion->is_enabled() && plugin_supports('mod', $module->name, FEATURE_MODEDIT_DEFAULT_COMPLETION, true)) { $data->completion = COMPLETION_TRACKING_MANUAL; + $data->completionview = 1; } } } diff --git a/completion/tests/behat/default_activity_completion.feature b/completion/tests/behat/default_activity_completion.feature index c2b923c54cd..f589c4eed2f 100644 --- a/completion/tests/behat/default_activity_completion.feature +++ b/completion/tests/behat/default_activity_completion.feature @@ -38,10 +38,11 @@ Feature: Allow teachers to bulk edit activity completion rules in a course. And I should see "Completion tracking" And I should see "The changes will affect the following 1 Activities/Resources" And I should see "Student must submit to this activity to complete it" - And I select "Show activity as complete when conditions are met" from the "completion" singleselect - And I click on "completionview" "checkbox" - And I click on "completionusegrade" "checkbox" - And I click on "completionsubmit" "checkbox" + And I set the following fields to these values: + | completion | Show activity as complete when conditions are met| + | completionview | 1 | + | completionusegrade | 1 | + | completionsubmit | 1 | And I click on "Save changes" "button" Then I should see "Changes saved" And I should see "With conditions" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Assignments']]" "xpath_element" diff --git a/mod/assign/mod_form.php b/mod/assign/mod_form.php index 3fe7be35aab..3a2327266d4 100644 --- a/mod/assign/mod_form.php +++ b/mod/assign/mod_form.php @@ -283,7 +283,7 @@ class mod_assign_mod_form extends moodleform_mod { public function add_completion_rules() { $mform =& $this->_form; - $mform->addElement('checkbox', 'completionsubmit', '', get_string('completionsubmit', 'assign')); + $mform->addElement('advcheckbox', 'completionsubmit', '', get_string('completionsubmit', 'assign')); // Enable this completion rule by default. $mform->setDefault('completionsubmit', 1); return array('completionsubmit');