1 |
efrain |
1 |
@core @core_completion @javascript
|
|
|
2 |
Feature: Allow teachers to edit the default activity completion rules in a course.
|
|
|
3 |
In order to set the activity completion defaults for new 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 | numsections |
|
|
|
10 |
| Course 1 | C1 | 0 | 1 | 1 |
|
|
|
11 |
And the following "users" exist:
|
|
|
12 |
| username | firstname | lastname | email |
|
|
|
13 |
| teacher1 | Teacher | First | teacher1@example.com |
|
|
|
14 |
And the following "course enrolments" exist:
|
|
|
15 |
| user | course | role |
|
|
|
16 |
| teacher1 | C1 | editingteacher |
|
|
|
17 |
|
|
|
18 |
# Given I am a teacher in a course with completion tracking enabled and activities present.
|
|
|
19 |
# When I edit activity completion defaults for activity types.
|
|
|
20 |
# Then the completion rule defaults should apply only to activities created from that point onwards.
|
|
|
21 |
Scenario: Edit default activity completion rules for assignment
|
|
|
22 |
Given the following "activity" exists:
|
|
|
23 |
| activity | assign |
|
|
|
24 |
| course | C1 |
|
|
|
25 |
| name | Test assignment one |
|
|
|
26 |
| completion | 0 |
|
|
|
27 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
28 |
When I navigate to "Course completion" in current page administration
|
|
|
29 |
And I set the field "Course completion tertiary navigation" to "Default activity completion"
|
|
|
30 |
And I click on "Expand Assignment" "button"
|
|
|
31 |
And I set the following fields to these values:
|
|
|
32 |
| id_completion_assign_2 | 1 |
|
|
|
33 |
| completionview_assign | 1 |
|
|
|
34 |
| completionusegrade_assign | 1 |
|
|
|
35 |
| completionsubmit_assign | 1 |
|
|
|
36 |
And I should not see "Cancel" in the "[data-region='activitycompletion-forum']" "css_element"
|
|
|
37 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
|
|
|
38 |
Then I should see "Changes saved"
|
|
|
39 |
And I navigate to "Course completion" in current page administration
|
|
|
40 |
And I set the field "Course completion tertiary navigation" to "Default activity completion"
|
|
|
41 |
And I click on "Expand Assignment" "button"
|
|
|
42 |
And I set the following fields to these values:
|
|
|
43 |
| completionview_assign | 0 |
|
|
|
44 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
|
|
|
45 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
46 |
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
|
|
47 |
And I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
|
|
|
48 |
And I expand all fieldsets
|
|
|
49 |
# Completion tracking 2 = Add requirements.
|
|
|
50 |
And the field "Add requirements" matches value "1"
|
|
|
51 |
And the field "completionview" matches value "0"
|
|
|
52 |
And the field "completionusegrade" matches value "1"
|
|
|
53 |
And the field "completionsubmit" matches value "1"
|
|
|
54 |
But I am on the "Test assignment one" Activity page
|
|
|
55 |
And I navigate to "Settings" in current page administration
|
|
|
56 |
And I expand all fieldsets
|
|
|
57 |
# Completion tracking 0 = Do not indicate activity completion.
|
|
|
58 |
And the field "None" matches value "1"
|
|
|
59 |
|
|
|
60 |
Scenario: Edit default activity completion rules for forum
|
|
|
61 |
Given the following "activity" exists:
|
|
|
62 |
| activity | forum |
|
|
|
63 |
| course | C1 |
|
|
|
64 |
| name | Test forum one |
|
|
|
65 |
| completion | 0 |
|
|
|
66 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
67 |
When I navigate to "Course completion" in current page administration
|
|
|
68 |
And I set the field "Course completion tertiary navigation" to "Default activity completion"
|
|
|
69 |
And I click on "Expand Forum" "button"
|
|
|
70 |
And I set the following fields to these values:
|
|
|
71 |
# 2 = Add requeriments.
|
|
|
72 |
| id_completion_forum_2 | 1 |
|
|
|
73 |
| completionview_forum | 0 |
|
|
|
74 |
# 0 = Rating.
|
|
|
75 |
| completionusegrade_forum | 1 |
|
|
|
76 |
| completiongradeitemnumber_forum | 0 |
|
|
|
77 |
# 1 = Passing grade.
|
|
|
78 |
| completionpassgrade_forum | 1 |
|
|
|
79 |
| completionpostsenabled_forum | 1 |
|
|
|
80 |
| completionposts_forum | 2 |
|
|
|
81 |
| completionrepliesenabled_forum | 1 |
|
|
|
82 |
| completionreplies_forum | 3 |
|
|
|
83 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-forum']" "css_element"
|
|
|
84 |
Then I should see "Changes saved"
|
|
|
85 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
86 |
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
|
|
87 |
And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue"
|
|
|
88 |
And I expand all fieldsets
|
|
|
89 |
# Completion tracking 2 = Add requirements.
|
|
|
90 |
And the field "Add requirements" matches value "1"
|
|
|
91 |
And the field "completionview" matches value "0"
|
|
|
92 |
# Value 0 for completiongradeitemnumber is "Rating".
|
|
|
93 |
And the field "completiongradeitemnumber" matches value "0"
|
|
|
94 |
And the field "completionpassgrade" matches value "1"
|
|
|
95 |
And the field "completionpostsenabled" matches value "1"
|
|
|
96 |
And the field "completionposts" matches value "2"
|
|
|
97 |
And the field "completionrepliesenabled" matches value "1"
|
|
|
98 |
And the field "completionreplies" matches value "3"
|
|
|
99 |
But I am on the "Test forum one" Activity page
|
|
|
100 |
And I navigate to "Settings" in current page administration
|
|
|
101 |
And I expand all fieldsets
|
|
|
102 |
# None checked = Do not indicate activity completion.
|
|
|
103 |
And the field "None" matches value "1"
|
|
|
104 |
|
|
|
105 |
Scenario: Edit default activity completion rules for glossary
|
|
|
106 |
Given the following "activity" exists:
|
|
|
107 |
| activity | glossary |
|
|
|
108 |
| course | C1 |
|
|
|
109 |
| name | Test glossary one |
|
|
|
110 |
| completion | 0 |
|
|
|
111 |
And I am on the "Course 1" course page logged in as teacher1
|
|
|
112 |
When I navigate to "Course completion" in current page administration
|
|
|
113 |
And I set the field "Course completion tertiary navigation" to "Default activity completion"
|
|
|
114 |
And I click on "Expand Glossary" "button"
|
|
|
115 |
And I set the following fields to these values:
|
|
|
116 |
# Add requirements = 2.
|
|
|
117 |
| id_completion_glossary_2 | 1 |
|
|
|
118 |
| completionview_glossary | 0 |
|
|
|
119 |
| completionusegrade_glossary | 1 |
|
|
|
120 |
| completionentriesenabled_glossary | 1 |
|
|
|
121 |
| completionentries_glossary | 2 |
|
|
|
122 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-glossary']" "css_element"
|
|
|
123 |
Then I should see "Changes saved"
|
|
|
124 |
And I am on "Course 1" course homepage with editing mode on
|
|
|
125 |
And I click on "Add an activity or resource" "button" in the "New section" "section"
|
|
|
126 |
And I click on "Add a new Glossary" "link" in the "Add an activity or resource" "dialogue"
|
|
|
127 |
And I expand all fieldsets
|
|
|
128 |
# Completion tracking 2 = Add requirements.
|
|
|
129 |
And the field "Add requirements" matches value "1"
|
|
|
130 |
And the field "completionview" matches value "0"
|
|
|
131 |
And the field "completionusegrade" matches value "1"
|
|
|
132 |
And the field "completionentriesenabled" matches value "1"
|
|
|
133 |
And the field "completionentries" matches value "2"
|
|
|
134 |
But I am on the "Test glossary one" Activity page
|
|
|
135 |
And I navigate to "Settings" in current page administration
|
|
|
136 |
And I expand all fieldsets
|
|
|
137 |
# Completion tracking 0 = Do not indicate activity completion.
|
|
|
138 |
And the field "None" matches value "1"
|
|
|
139 |
|
|
|
140 |
Scenario: Edit default activity completion rules for several activities
|
|
|
141 |
Given I am on the "Course 1" course page logged in as teacher1
|
|
|
142 |
When I navigate to "Course completion" in current page administration
|
|
|
143 |
And I set the field "Course completion tertiary navigation" to "Default activity completion"
|
|
|
144 |
And I click on "Expand Assignment" "button"
|
|
|
145 |
And I set the following fields to these values:
|
|
|
146 |
| id_completion_assign_2 | 1 |
|
|
|
147 |
| completionview_assign | 0 |
|
|
|
148 |
| completionusegrade_assign | 0 |
|
|
|
149 |
| completionsubmit_assign | 1 |
|
|
|
150 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
|
|
|
151 |
And I should see "Changes saved"
|
|
|
152 |
And I click on "Expand Forum" "button"
|
|
|
153 |
And I set the following fields to these values:
|
|
|
154 |
| id_completion_forum_2 | 1 |
|
|
|
155 |
| completionview_forum | 0 |
|
|
|
156 |
| completionpostsenabled_forum | 1 |
|
|
|
157 |
| completionposts_forum | 3 |
|
|
|
158 |
| completiondiscussionsenabled_forum | 0 |
|
|
|
159 |
| completionrepliesenabled_forum | 0 |
|
|
|
160 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-forum']" "css_element"
|
|
|
161 |
And I should see "Changes saved"
|
|
|
162 |
And I click on "Expand SCORM package" "button"
|
|
|
163 |
And I set the following fields to these values:
|
|
|
164 |
| id_completion_scorm_2 | 1 |
|
|
|
165 |
| completionview_scorm | 0 |
|
|
|
166 |
| completionscoreenabled_scorm | 1 |
|
|
|
167 |
| completionscorerequired_scorm | 3 |
|
|
|
168 |
| completionstatusrequired_scorm[2] | 1 |
|
|
|
169 |
| completionstatusrequired_scorm[4] | 0 |
|
|
|
170 |
| completionstatusallscos_scorm | 1 |
|
|
|
171 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-scorm']" "css_element"
|
|
|
172 |
And I should see "Changes saved"
|
|
|
173 |
And I click on "Expand Book" "button"
|
|
|
174 |
And I set the following fields to these values:
|
|
|
175 |
| completion_book | Do not indicate activity completion |
|
|
|
176 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-book']" "css_element"
|
|
|
177 |
And I should see "Changes saved"
|
|
|
178 |
And I click on "Expand Lesson" "button"
|
|
|
179 |
And I set the following fields to these values:
|
|
|
180 |
# Students must manually mark the activity as done = 1.
|
|
|
181 |
| id_completion_lesson_1 | 1 |
|
|
|
182 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-lesson']" "css_element"
|
|
|
183 |
And I should see "Changes saved"
|
|
|
184 |
# Change current page and go back to "Default activity completion", to confirm the form values have been saved properly.
|
|
|
185 |
And I set the field "Course completion tertiary navigation" to "Course completion settings"
|
|
|
186 |
And I set the field "Course completion tertiary navigation" to "Default activity completion"
|
|
|
187 |
Then the field "id_completion_lesson_1" matches value "1"
|
|
|
188 |
# Check that the rules for book, assignment and forum are still the same.
|
|
|
189 |
And I click on "Expand Book" "button"
|
|
|
190 |
And the field "id_completion_book_0" matches value "1"
|
|
|
191 |
And I click on "Expand Assignment" "button"
|
|
|
192 |
And the field "id_completion_assign_2" matches value "1"
|
|
|
193 |
And the field "completionview_assign" matches value "0"
|
|
|
194 |
And the field "completionusegrade_assign" matches value "0"
|
|
|
195 |
And the field "completionsubmit_assign" matches value "1"
|
|
|
196 |
And I click on "Expand Forum" "button"
|
|
|
197 |
And the field "id_completion_forum_2" matches value "1"
|
|
|
198 |
And the field "completionview_forum" matches value "0"
|
|
|
199 |
And the field "completionpostsenabled_forum" matches value "1"
|
|
|
200 |
And the field "completionposts_forum" matches value "3"
|
|
|
201 |
And the field "completiondiscussionsenabled_forum" matches value "0"
|
|
|
202 |
And the field "completionrepliesenabled_forum" matches value "0"
|
|
|
203 |
And I click on "Expand SCORM package" "button"
|
|
|
204 |
And the field "id_completion_scorm_2" matches value "1"
|
|
|
205 |
And the field "completionview_scorm" matches value "0"
|
|
|
206 |
And the field "completionscoreenabled_scorm" matches value "1"
|
|
|
207 |
And the field "completionscorerequired_scorm" matches value "3"
|
|
|
208 |
And the field "completionstatusrequired_scorm[2]" matches value "1"
|
|
|
209 |
And the field "completionstatusrequired_scorm[4]" matches value "0"
|
|
|
210 |
And the field "completionstatusallscos_scorm" matches value "1"
|
|
|
211 |
|
|
|
212 |
Scenario: Edit default activity completion without rules for automatic completion
|
|
|
213 |
Given I am on the "Course 1" course page logged in as teacher1
|
|
|
214 |
When I navigate to "Course completion" in current page administration
|
|
|
215 |
And I set the field "Course completion tertiary navigation" to "Default activity completion"
|
|
|
216 |
And I click on "Expand Assignment" "button"
|
|
|
217 |
And I set the following fields to these values:
|
|
|
218 |
| id_completion_assign_2 | 1 |
|
|
|
219 |
| completionview_assign | 0 |
|
|
|
220 |
| completionusegrade_assign | 0 |
|
|
|
221 |
| completionsubmit_assign | 0 |
|
|
|
222 |
And I click on "Save changes" "button" in the "[data-region='activitycompletion-assign']" "css_element"
|
|
|
223 |
Then I should see "You must select at least one condition"
|
|
|
224 |
And I should not see "Changes saved"
|
|
|
225 |
|
|
|
226 |
Scenario: Activities in Default activity completion are ordered alphabetically
|
|
|
227 |
Given I am on the "Course 1" course page logged in as teacher1
|
|
|
228 |
When I navigate to "Course completion" in current page administration
|
|
|
229 |
And I set the field "Course completion tertiary navigation" to "Default activity completion"
|
|
|
230 |
Then "Quiz" "text" should appear before "Text and media area" "text"
|
|
|
231 |
|
|
|
232 |
@accessibility
|
|
|
233 |
Scenario: Evaluate the accessibility of the default activity completion page
|
|
|
234 |
Given I am on the "Course 1" course page logged in as "teacher1"
|
|
|
235 |
When I navigate to "Course completion" in current page administration
|
|
|
236 |
And I set the field "Course completion tertiary navigation" to "Default activity completion"
|
|
|
237 |
And the page should meet accessibility standards
|