Skip to content

Commit

Permalink
MDL-58138 completion: changes after rebasing
Browse files Browse the repository at this point in the history
The defaults for the completion have been changed in MDL-55611
  • Loading branch information
marinaglancy authored and snake committed Apr 19, 2017
1 parent 61167c1 commit 32b93ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions completion/classes/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ public static function get_default_completion($course, $module, $flatten = true)
$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;
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions completion/tests/behat/default_activity_completion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion mod/assign/mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ public function data_preprocessing(&$defaultvalues) {
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');
Expand Down

0 comments on commit 32b93ea

Please sign in to comment.