forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-48452 Completion: Expected date doesn't save when form is locked
The completion fields are locked when a user has already completed the task, to prevent you accidentally causing it to recalculate the data. This lock doesn't apply to the expected date field, as this doesn't affect user completion. However, changes to the field in this situation were incorrectly not saved.
- Loading branch information
1 parent
2d84748
commit af729c3
Showing
2 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
@core @core_course | ||
Feature: Edit completion settings of an activity | ||
In order to edit completion settings without accidentally breaking user data | ||
As a teacher | ||
I need to edit the activity and use the unlock button if required | ||
|
||
Background: | ||
Given I log in as "admin" | ||
And I set the following administration settings values: | ||
| Enable completion tracking | 1 | | ||
And I log out | ||
And the following "courses" exist: | ||
| fullname | shortname | enablecompletion | | ||
| Course 1 | C1 | 1 | | ||
And the following "activities" exist: | ||
| activity | course | idnumber | name | intro | content | completion | completionview | | ||
| page | C1 | x | TestPage | x | x | 2 | 1 | | ||
And I log in as "admin" | ||
And I follow "Course 1" | ||
|
||
Scenario: Completion is not locked when the activity has not yet been viewed | ||
Given I turn editing mode on | ||
And I click on "Edit settings" "link" in the "TestPage" activity | ||
When I expand all fieldsets | ||
Then I should see "Completion tracking" | ||
And I should not see "Completion options locked" | ||
|
||
Scenario: Completion is locked after the activity has been viewed | ||
Given I follow "TestPage" | ||
When I follow "Edit settings" | ||
And I expand all fieldsets | ||
Then I should see "Completion options locked" | ||
|
||
@javascript | ||
Scenario: Pressing the unlock button allows the user to edit completion settings | ||
Given I follow "TestPage" | ||
When I follow "Edit settings" | ||
And I expand all fieldsets | ||
And I press "Unlock completion options" | ||
Then I should see "Completion options unlocked" | ||
And I set the field "Completion tracking" to "Students can manually mark the activity as completed" | ||
And I press "Save and display" | ||
And I follow "Edit settings" | ||
And I expand all fieldsets | ||
Then the field "Completion tracking" matches value "Students can manually mark the activity as completed" | ||
|
||
@javascript | ||
Scenario: Even when completion is locked, the user can still set the date | ||
Given I follow "TestPage" | ||
And I follow "Edit settings" | ||
And I expand all fieldsets | ||
When I click on "id_completionexpected_enabled" "checkbox" | ||
And I set the field "id_completionexpected_year" to "2013" | ||
And I press "Save and display" | ||
And I follow "Edit settings" | ||
And I expand all fieldsets | ||
Then the field "id_completionexpected_year" matches value "2013" |