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
5 I need to be able to edit the completion rules for a group of activities.
8 Given the following "courses" exist:
9 | fullname | shortname | category |
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! | 300 |
22 | assign | C1 | a2 | Test assignment two | Submit something! | 100 |
23 | assign | C1 | a3 | Test assignment three | Submit something! | 150 |
24 | assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
25 And I log in as "teacher1"
26 And I am on "Course 1" course homepage with editing mode on
27 And I navigate to "Settings" in current page administration
28 And I set the following fields to these values:
29 | Enable completion tracking | Yes |
30 And I press "Save and display"
33 # Given I am a teacher in a course with completion tracking enabled and activities present.
34 # When I bulk edit activity completion rules for activities of the same kind.
35 # Then the completion rules should be updated for all selected activities.
36 Scenario: Bulk edit activity completion rules
37 Given I log in as "teacher1"
38 And I am on "Course 1" course homepage with editing mode on
39 When I navigate to "Course completion" in current page administration
40 And I select "Bulk edit activity completion" from the "Course completion tertiary navigation" singleselect
41 And I click on "Test assignment one" "checkbox"
42 And I click on "Test assignment two" "checkbox"
43 And I click on "Edit" "button"
44 And I should see "Completion tracking"
45 And I should see "The changes will affect the following 2 activities or resources:"
46 And I should see "Student must make a submission"
47 And I select "Show activity as complete when conditions are met" from the "completion" singleselect
48 And I click on "completionview" "checkbox"
49 And I click on "completionusegrade" "checkbox"
50 And I click on "completionsubmit" "checkbox"
51 And I click on "Save changes" "button"
52 Then I should see "Changes saved"
53 And I should see "With conditions" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
54 And I should see "Student must view this activity to complete it" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
55 And I should see "Student must receive a grade to complete this activity" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
56 And I should see "Student must make a submission" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
57 And I should not see "Completion expected on" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
58 And I should see "With conditions" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
59 And I should see "Student must view this activity to complete it" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
60 And I should see "Student must receive a grade to complete this activity" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
61 And I should see "Student must make a submission" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
62 And I should not see "Completion expected on" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
64 # Same conditions as above,
65 # However if completionpassgrade is set, only the completionpassgrade detail should be shown.
66 # It is implied requires grade is selected as it passgrade is dependent on it.
67 Scenario: Bulk edit passing grade completion
68 Given I log in as "teacher1"
69 And I am on "Course 1" course homepage with editing mode on
70 When I navigate to "Course completion" in current page administration
71 And I select "Bulk edit activity completion" from the "Course completion tertiary navigation" singleselect
72 And I click on "Test assignment one" "checkbox"
73 And I click on "Test assignment two" "checkbox"
74 And I click on "Edit" "button"
75 And I should see "Completion tracking"
76 And I should see "The changes will affect the following 2 activities or resources:"
77 And I should see "Student must make a submission"
78 And I select "Show activity as complete when conditions are met" from the "completion" singleselect
79 And I click on "completionusegrade" "checkbox"
80 And I click on "completionpassgrade" "checkbox"
81 And I click on "Save changes" "button"
82 Then I should see "Changes saved"
83 And I should see "With conditions" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
84 And I should see "Student must receive a passing grade to complete this activity" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
85 And I should not see "Completion expected on" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment one']]" "xpath_element"
86 And I should see "With conditions" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
87 And I should see "Student must receive a passing grade to complete this activity" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
88 And I should not see "Completion expected on" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' row ')][.//*[text() = 'Test assignment two']]" "xpath_element"
91 Scenario: Evaluate the accessibility of the bulk edit activity completion page
92 Given I am on the "Course 1" course page logged in as "teacher1"
93 When I navigate to "Course completion" in current page administration
94 And I set the field "Course completion tertiary navigation" to "Bulk edit activity completion"
95 And the page should meet "wcag21aa" accessibility standards