1 |
efrain |
1 |
@core @core_completion @javascript
|
|
|
2 |
Feature: Allow teachers to bulk edit activity completion rules in a course.
|
|
|
3 |
In order to avoid editing single activities
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to be able to edit the completion rules for a group of activities.
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "courses" exist:
|
|
|
9 |
| fullname | shortname | category | enablecompletion |
|
|
|
10 |
| Course 1 | C1 | 0 | 1 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| teacher1 | Teacher | First | teacher1@example.com |
|
|
|
14 |
| student1 | Student | First | student1@example.com |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | course | idnumber | name | intro | grade |
|
|
|
21 |
| assign | C1 | a1 | Test assignment one | Submit something! | 30 |
|
|
|
22 |
| assign | C1 | a2 | Test assignment two | Submit something! | 10 |
|
|
|
23 |
| assign | C1 | a3 | Test assignment three | Submit something! | 15 |
|
|
|
24 |
| assign | C1 | a4 | Test assignment four | Submit nothing! | 15 |
|
|
|
25 |
And I log out
|
|
|
26 |
|
|
|
27 |
# Given I am a teacher in a course with completion tracking enabled and activities present.
|
|
|
28 |
# When I bulk edit activity completion rules for activities of the same kind.
|
|
|
29 |
# Then the completion rules should be updated for all selected activities.
|
|
|
30 |
Scenario: Bulk edit activity completion rules
|
|
|
31 |
Given I log in as "teacher1"
|
|
|
32 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
33 |
When I navigate to "Course completion" in current page administration
|
|
|
34 |
And I set the field "Course completion tertiary navigation" to "Bulk edit activity completion"
|
|
|
35 |
And I click on "Test assignment one" "checkbox"
|
|
|
36 |
And I click on "Test assignment two" "checkbox"
|
|
|
37 |
And I click on "Edit" "button"
|
|
|
38 |
And I should see "The changes will affect the following 2 activities or resources:"
|
|
|
39 |
And I set the following fields to these values:
|
|
|
40 |
| Add requirements | 1 |
|
|
|
41 |
| View the activity | 1 |
|
|
|
42 |
| Make a submission | 1 |
|
|
|
43 |
| Receive a grade | 1 |
|
|
|
44 |
And I click on "Save changes" "button"
|
|
|
45 |
Then I should see "Changes saved"
|
|
|
46 |
And I should see "With conditions" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
|
|
|
47 |
And I should see "View the activity" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
|
|
|
48 |
And I should see "Receive a grade" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
|
|
|
49 |
And I should see "Make a submission" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
|
|
|
50 |
And I should not see "Completion expected on" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
|
|
|
51 |
And I should see "With conditions" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
|
|
|
52 |
And I should see "View the activity" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
|
|
|
53 |
And I should see "Receive a grade" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
|
|
|
54 |
And I should see "Make a submission" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
|
|
|
55 |
And I should not see "Completion expected on" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
|
|
|
56 |
|
|
|
57 |
# Same conditions as above,
|
|
|
58 |
# However if completionpassgrade is set, only the completionpassgrade detail should be shown.
|
|
|
59 |
# It is implied requires grade is selected as it passgrade is dependent on it.
|
|
|
60 |
Scenario: Bulk edit passing grade completion
|
|
|
61 |
Given I log in as "teacher1"
|
|
|
62 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
63 |
When I navigate to "Course completion" in current page administration
|
|
|
64 |
And I set the field "Course completion tertiary navigation" to "Bulk edit activity completion"
|
|
|
65 |
And I click on "Test assignment one" "checkbox"
|
|
|
66 |
And I click on "Test assignment two" "checkbox"
|
|
|
67 |
And I click on "Edit" "button"
|
|
|
68 |
And I should see "The changes will affect the following 2 activities or resources:"
|
|
|
69 |
And I set the field "Add requirements" to "1"
|
|
|
70 |
And I should see "Make a submission"
|
|
|
71 |
And I set the field "Receive a grade" to "1"
|
|
|
72 |
And I set the field "Passing grade" to "1"
|
|
|
73 |
And I click on "Save changes" "button"
|
|
|
74 |
Then I should see "Changes saved"
|
|
|
75 |
And I should see "With conditions" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
|
|
|
76 |
And I should see "Passing grade" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
|
|
|
77 |
And I should not see "Completion expected on" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
|
|
|
78 |
And I should see "With conditions" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
|
|
|
79 |
And I should see "Passing grade" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
|
|
|
80 |
And I should not see "Completion expected on" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
|
|
|
81 |
|
|
|
82 |
@accessibility
|
|
|
83 |
Scenario: Evaluate the accessibility of the bulk edit activity completion page
|
|
|
84 |
Given I am on the "Course 1" course page logged in as "teacher1"
|
|
|
85 |
When I navigate to "Course completion" in current page administration
|
|
|
86 |
And I set the field "Course completion tertiary navigation" to "Bulk edit activity completion"
|
|
|
87 |
And the page should meet accessibility standards
|