1 |
efrain |
1 |
@core @core_course @core_completion
|
|
|
2 |
Feature: Edit completion settings of an activity
|
|
|
3 |
In order to edit completion settings without accidentally breaking user data
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to edit the activity and use the unlock button if required
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | enablecompletion |
|
|
|
10 |
| Course 1 | C1 | 1 |
|
|
|
11 |
And the following "activities" exist:
|
|
|
12 |
| activity | course | idnumber | intro | name | completion | completionview |
|
|
|
13 |
| page | C1 | p1 | x | TestPage | 2 | 1 |
|
|
|
14 |
|
|
|
15 |
Scenario: Completion is not locked when the activity has not yet been viewed
|
|
|
16 |
Given I am on the TestPage "Page Activity editing" page logged in as admin
|
|
|
17 |
When I expand all fieldsets
|
|
|
18 |
Then I should see "Completion conditions"
|
|
|
19 |
And I should not see "Completion options locked"
|
|
|
20 |
|
|
|
21 |
Scenario: Completion is locked after the activity has been viewed
|
|
|
22 |
Given I am on the TestPage "Page Activity" page logged in as admin
|
|
|
23 |
When I am on the TestPage "Page Activity editing" page
|
|
|
24 |
And I expand all fieldsets
|
|
|
25 |
Then I should see "Completion options locked"
|
|
|
26 |
|
|
|
27 |
@javascript
|
|
|
28 |
Scenario: Pressing the unlock button allows the user to edit completion settings
|
|
|
29 |
Given I am on the TestPage "Page Activity" page logged in as admin
|
|
|
30 |
When I am on the TestPage "Page Activity editing" page
|
|
|
31 |
And I expand all fieldsets
|
|
|
32 |
And I press "Unlock completion settings"
|
|
|
33 |
And I expand all fieldsets
|
|
|
34 |
Then I should see "Completion options unlocked"
|
|
|
35 |
And I set the field "Students must manually mark the activity as done" to "1"
|
|
|
36 |
And I press "Save and display"
|
|
|
37 |
And I navigate to "Settings" in current page administration
|
|
|
38 |
And I expand all fieldsets
|
|
|
39 |
Then the field "Students must manually mark the activity as done" matches value "1"
|
|
|
40 |
|
|
|
41 |
@javascript
|
|
|
42 |
Scenario: Even when completion is locked, the user can still set the date
|
|
|
43 |
Given I am on the TestPage "Page Activity" page logged in as admin
|
|
|
44 |
And I am on the TestPage "Page Activity editing" page
|
|
|
45 |
And I expand all fieldsets
|
|
|
46 |
When I click on "id_completionexpected_enabled" "checkbox"
|
|
|
47 |
And I set the field "id_completionexpected_year" to "2013"
|
|
|
48 |
And I press "Save and display"
|
|
|
49 |
And I navigate to "Settings" in current page administration
|
|
|
50 |
And I expand all fieldsets
|
|
|
51 |
Then the field "id_completionexpected_year" matches value "2013"
|