1 |
efrain |
1 |
@mod @mod_feedback
|
|
|
2 |
Feature: Feedbacks in courses with groups
|
|
|
3 |
In order to collect feedbacks per group
|
|
|
4 |
As an teacher
|
|
|
5 |
I need to be able to filter feedback replies by groups
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname |
|
|
|
10 |
| user1 | Username | 1 |
|
|
|
11 |
| user2 | Username | 2 |
|
|
|
12 |
| user3 | Username | 3 |
|
|
|
13 |
| user4 | Username | 4 |
|
|
|
14 |
| user5 | Username | 5 |
|
|
|
15 |
| user6 | Username | 6 |
|
|
|
16 |
| user7 | Username | 7 |
|
|
|
17 |
| user8 | Username | 8 |
|
|
|
18 |
| teacher | Teacher | T |
|
|
|
19 |
| manager | Manager | M |
|
|
|
20 |
And the following "courses" exist:
|
|
|
21 |
| fullname | shortname | groupmode |
|
|
|
22 |
| Course 1 | C1 | 1 |
|
|
|
23 |
And the following "course enrolments" exist:
|
|
|
24 |
| user | course | role |
|
|
|
25 |
| user1 | C1 | student |
|
|
|
26 |
| user2 | C1 | student |
|
|
|
27 |
| user3 | C1 | student |
|
|
|
28 |
| user4 | C1 | student |
|
|
|
29 |
| user5 | C1 | student |
|
|
|
30 |
| user6 | C1 | student |
|
|
|
31 |
| user7 | C1 | student |
|
|
|
32 |
| user8 | C1 | student |
|
|
|
33 |
| teacher | C1 | editingteacher |
|
|
|
34 |
And the following "groups" exist:
|
|
|
35 |
| name | course | idnumber | participation |
|
|
|
36 |
| Group 1 | C1 | G1 | 1 |
|
|
|
37 |
| Group 2 | C1 | G2 | 1 |
|
|
|
38 |
| Group 3 | C1 | G3 | 0 |
|
|
|
39 |
And the following "group members" exist:
|
|
|
40 |
| user | group |
|
|
|
41 |
| user1 | G1 |
|
|
|
42 |
| user2 | G1 |
|
|
|
43 |
| user2 | G2 |
|
|
|
44 |
| user3 | G2 |
|
|
|
45 |
| user4 | G1 |
|
|
|
46 |
| user5 | G1 |
|
|
|
47 |
| user6 | G2 |
|
|
|
48 |
| user8 | G3 |
|
|
|
49 |
And the following "system role assigns" exist:
|
|
|
50 |
| user | course | role |
|
|
|
51 |
| manager | Acceptance test site | manager |
|
|
|
52 |
And the following "activities" exist:
|
|
|
53 |
| activity | name | course | idnumber | anonymous | publish_stats | groupmode | section |
|
|
|
54 |
| feedback | Site feedback | Acceptance test site | feedback0 | 2 | 1 | 1 | 1 |
|
|
|
55 |
| feedback | Course feedback | C1 | feedback1 | 2 | 1 | 1 | 0 |
|
|
|
56 |
| feedback | Course anon feedback | C1 | feedback2 | 1 | 1 | 1 | 0 |
|
|
|
57 |
|
|
|
58 |
@javascript
|
|
|
59 |
Scenario: Non anonymous feedback with groups in a course
|
|
|
60 |
Given the following "mod_feedback > question" exists:
|
|
|
61 |
| activity | feedback1 |
|
|
|
62 |
| name | Do you like this course? |
|
|
|
63 |
| questiontype | multichoice |
|
|
|
64 |
| label | multichoice1 |
|
|
|
65 |
| subtype | r |
|
|
|
66 |
| hidenoselect | 1 |
|
|
|
67 |
| values | Yes of course\nNot at all\nI don't know |
|
|
|
68 |
And the following "mod_feedback > responses" exist:
|
|
|
69 |
| activity | user | Do you like this course? |
|
|
|
70 |
| feedback1 | user1 | Not at all |
|
|
|
71 |
| feedback1 | user2 | I don't know |
|
|
|
72 |
| feedback1 | user3 | Not at all |
|
|
|
73 |
| feedback1 | user4 | Yes of course |
|
|
|
74 |
| feedback1 | user5 | Yes of course |
|
|
|
75 |
| feedback1 | user6 | Not at all |
|
|
|
76 |
| feedback1 | user7 | I don't know |
|
|
|
77 |
| feedback1 | user8 | Yes of course |
|
|
|
78 |
# View analysis, user1 should only see one group - group 1
|
|
|
79 |
When I am on the "Course feedback" "feedback activity" page logged in as user1
|
|
|
80 |
And I follow "Analysis"
|
|
|
81 |
And I should see "Separate groups: Group 1"
|
|
|
82 |
And I show chart data for the "multichoice1" feedback
|
|
|
83 |
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
|
|
|
84 |
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
|
|
|
85 |
And I log out
|
|
|
86 |
# View analysis, user3 should only see one group - group 2
|
|
|
87 |
And I am on the "Course feedback" "feedback activity" page logged in as user3
|
|
|
88 |
And I follow "Analysis"
|
|
|
89 |
And I should see "Separate groups: Group 2"
|
|
|
90 |
And I show chart data for the "multichoice1" feedback
|
|
|
91 |
And I should see "0" in the "Yes of course" "table_row"
|
|
|
92 |
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
|
|
|
93 |
And I log out
|
|
|
94 |
# View analysis, user2 should see a group selector and be able to change the group but not view all.
|
|
|
95 |
And I am on the "Course feedback" "feedback activity" page logged in as user2
|
|
|
96 |
And I follow "Analysis"
|
|
|
97 |
And the field "Separate groups" matches value "Group 1"
|
|
|
98 |
And I should not see "Group 3" in the "Separate groups" "select"
|
|
|
99 |
And I show chart data for the "multichoice1" feedback
|
|
|
100 |
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
|
|
|
101 |
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
|
|
|
102 |
And I select "Group 2" from the "Separate groups" singleselect
|
|
|
103 |
And I show chart data for the "multichoice1" feedback
|
|
|
104 |
And I should see "0" in the "Yes of course" "table_row"
|
|
|
105 |
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
|
|
|
106 |
And the "Separate groups" select box should not contain "All participants"
|
|
|
107 |
And I log out
|
|
|
108 |
# User without group can see all participants only
|
|
|
109 |
And I am on the "Course feedback" "feedback activity" page logged in as user7
|
|
|
110 |
And I follow "Analysis"
|
|
|
111 |
And I should see "Separate groups: All participants"
|
|
|
112 |
And I show chart data for the "multichoice1" feedback
|
|
|
113 |
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
|
|
|
114 |
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
|
|
|
115 |
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
|
|
|
116 |
And I log out
|
|
|
117 |
# User in non-participation group sees the same as no groups
|
|
|
118 |
And I am on the "Course feedback" "feedback activity" page logged in as user8
|
|
|
119 |
And I follow "Analysis"
|
|
|
120 |
And I should see "Separate groups: All participants"
|
|
|
121 |
And I show chart data for the "multichoice1" feedback
|
|
|
122 |
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
|
|
|
123 |
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
|
|
|
124 |
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
|
|
|
125 |
And I log out
|
|
|
126 |
# Teacher can browse everybody
|
|
|
127 |
And I am on the "Course feedback" "feedback activity" page logged in as teacher
|
|
|
128 |
And I navigate to "Analysis" in current page administration
|
|
|
129 |
And the field "Separate groups" matches value "All participants"
|
|
|
130 |
And I should not see "Group 3" in the "Separate groups" "select"
|
|
|
131 |
And I show chart data for the "multichoice1" feedback
|
|
|
132 |
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
|
|
|
133 |
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
|
|
|
134 |
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
|
|
|
135 |
And I select "Group 1" from the "Separate groups" singleselect
|
|
|
136 |
And I show chart data for the "multichoice1" feedback
|
|
|
137 |
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
|
|
|
138 |
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
|
|
|
139 |
And I select "Group 2" from the "Separate groups" singleselect
|
|
|
140 |
And I show chart data for the "multichoice1" feedback
|
|
|
141 |
And I should see "0" in the "Yes of course" "table_row"
|
|
|
142 |
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
|
|
|
143 |
And I am on the "Course feedback" "feedback activity" page
|
|
|
144 |
And I navigate to "Responses" in current page administration
|
|
|
145 |
And the field "Separate groups" matches value "Group 2"
|
|
|
146 |
And I should not see "Username 1"
|
|
|
147 |
And I should see "Username 3"
|
|
|
148 |
And I select "Group 1" from the "Separate groups" singleselect
|
|
|
149 |
And I should see "Username 1"
|
|
|
150 |
And I should not see "Username 3"
|
|
|
151 |
And I select "All participants" from the "Separate groups" singleselect
|
|
|
152 |
And I should see "Username 1"
|
|
|
153 |
And I should see "Username 3"
|
|
|
154 |
|
|
|
155 |
@javascript
|
|
|
156 |
Scenario: Anonymous feedback with groups in a course - insufficient responses
|
|
|
157 |
Given the following "mod_feedback > question" exists:
|
|
|
158 |
| activity | feedback2 |
|
|
|
159 |
| name | Do you like this course? |
|
|
|
160 |
| questiontype | multichoice |
|
|
|
161 |
| label | multichoice1 |
|
|
|
162 |
| subtype | r |
|
|
|
163 |
| hidenoselect | 1 |
|
|
|
164 |
| values | Yes of course\nNot at all\nI don't know |
|
|
|
165 |
And the following "mod_feedback > responses" exist:
|
|
|
166 |
| activity | user | Do you like this course? |
|
|
|
167 |
| feedback2 | user1 | Not at all |
|
|
|
168 |
When I am on the "Course anon feedback" "feedback activity" page logged in as user1
|
|
|
169 |
And I follow "Analysis"
|
|
|
170 |
Then I should not see "Yes of course"
|
|
|
171 |
And I should see "There are insufficient responses for this group"
|
|
|
172 |
|
|
|
173 |
@javascript
|
|
|
174 |
Scenario: Anonymous feedback with groups in a course
|
|
|
175 |
Given the following "mod_feedback > question" exists:
|
|
|
176 |
| activity | feedback2 |
|
|
|
177 |
| name | Do you like this course? |
|
|
|
178 |
| questiontype | multichoice |
|
|
|
179 |
| label | multichoice1 |
|
|
|
180 |
| subtype | r |
|
|
|
181 |
| hidenoselect | 1 |
|
|
|
182 |
| values | Yes of course\nNot at all\nI don't know |
|
|
|
183 |
And the following "mod_feedback > responses" exist:
|
|
|
184 |
| activity | user | Do you like this course? |
|
|
|
185 |
| feedback2 | user1 | Not at all |
|
|
|
186 |
| feedback2 | user2 | I don't know |
|
|
|
187 |
| feedback2 | user3 | Not at all |
|
|
|
188 |
| feedback2 | user4 | Yes of course |
|
|
|
189 |
| feedback2 | user5 | Yes of course |
|
|
|
190 |
| feedback2 | user6 | Not at all |
|
|
|
191 |
| feedback2 | user7 | I don't know |
|
|
|
192 |
| feedback2 | user8 | Yes of course |
|
|
|
193 |
# View analysis, user1 should only see one group - group 1
|
|
|
194 |
When I am on the "Course anon feedback" "feedback activity" page logged in as user1
|
|
|
195 |
And I follow "Analysis"
|
|
|
196 |
And I should see "Separate groups: Group 1"
|
|
|
197 |
And I show chart data for the "multichoice1" feedback
|
|
|
198 |
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
|
|
|
199 |
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
|
|
|
200 |
And I log out
|
|
|
201 |
# View analysis, user3 should only see one group - group 2
|
|
|
202 |
And I am on the "Course anon feedback" "feedback activity" page logged in as user3
|
|
|
203 |
And I follow "Analysis"
|
|
|
204 |
And I should see "Separate groups: Group 2"
|
|
|
205 |
And I show chart data for the "multichoice1" feedback
|
|
|
206 |
And I should see "0" in the "Yes of course" "table_row"
|
|
|
207 |
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
|
|
|
208 |
And I log out
|
|
|
209 |
# View analysis, user2 should see a group selector and be able to change the group but not view all.
|
|
|
210 |
And I am on the "Course anon feedback" "feedback activity" page logged in as user2
|
|
|
211 |
And I follow "Analysis"
|
|
|
212 |
And the field "Separate groups" matches value "Group 1"
|
|
|
213 |
And I show chart data for the "multichoice1" feedback
|
|
|
214 |
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
|
|
|
215 |
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
|
|
|
216 |
And I select "Group 2" from the "Separate groups" singleselect
|
|
|
217 |
And I show chart data for the "multichoice1" feedback
|
|
|
218 |
And I should see "0" in the "Yes of course" "table_row"
|
|
|
219 |
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
|
|
|
220 |
And the "Separate groups" select box should not contain "All participants"
|
|
|
221 |
And I log out
|
|
|
222 |
# User without group can see all participants only
|
|
|
223 |
And I am on the "Course anon feedback" "feedback activity" page logged in as user7
|
|
|
224 |
And I follow "Analysis"
|
|
|
225 |
And I should see "Separate groups: All participants"
|
|
|
226 |
And I show chart data for the "multichoice1" feedback
|
|
|
227 |
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
|
|
|
228 |
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
|
|
|
229 |
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
|
|
|
230 |
And I log out
|
|
|
231 |
# User in non-participation group is the same as no groups.
|
|
|
232 |
And I am on the "Course anon feedback" "feedback activity" page logged in as user8
|
|
|
233 |
And I follow "Analysis"
|
|
|
234 |
And I should see "Separate groups: All participants"
|
|
|
235 |
And I show chart data for the "multichoice1" feedback
|
|
|
236 |
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
|
|
|
237 |
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
|
|
|
238 |
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
|
|
|
239 |
And I log out
|
|
|
240 |
# Teacher can browse everybody
|
|
|
241 |
And I am on the "Course anon feedback" "feedback activity" page logged in as teacher
|
|
|
242 |
And I navigate to "Analysis" in current page administration
|
|
|
243 |
And the field "Separate groups" matches value "All participants"
|
|
|
244 |
And I show chart data for the "multichoice1" feedback
|
|
|
245 |
And I should see "3 (37.50 %)" in the "Yes of course" "table_row"
|
|
|
246 |
And I should see "3 (37.50 %)" in the "Not at all" "table_row"
|
|
|
247 |
And I should see "2 (25.00 %)" in the "I don't know" "table_row"
|
|
|
248 |
And I select "Group 1" from the "Separate groups" singleselect
|
|
|
249 |
And I show chart data for the "multichoice1" feedback
|
|
|
250 |
And I should see "2 (50.00 %)" in the "Yes of course" "table_row"
|
|
|
251 |
And I should see "1 (25.00 %)" in the "Not at all" "table_row"
|
|
|
252 |
And I select "Group 2" from the "Separate groups" singleselect
|
|
|
253 |
And I show chart data for the "multichoice1" feedback
|
|
|
254 |
And I should see "0" in the "Yes of course" "table_row"
|
|
|
255 |
And I should see "2 (66.67 %)" in the "Not at all" "table_row"
|
|
|
256 |
And I am on the "Course anon feedback" "feedback activity" page
|
|
|
257 |
And I navigate to "Responses" in current page administration
|
|
|
258 |
# The response numbers were randomly allocated, we only can assert the number of visible responses here:
|
|
|
259 |
And the field "Separate groups" matches value "Group 2"
|
|
|
260 |
And "//tr[contains(@id,'_r2') and contains(.,'Response number')]" "xpath_element" should exist
|
|
|
261 |
And "//tr[contains(@id,'_r3') and contains(@class,'emptyrow')]" "xpath_element" should exist
|
|
|
262 |
And I select "Group 1" from the "Separate groups" singleselect
|
|
|
263 |
And "//tr[contains(@id,'_r3') and contains(.,'Response number')]" "xpath_element" should exist
|
|
|
264 |
And "//tr[contains(@id,'_r4') and contains(@class,'emptyrow')]" "xpath_element" should exist
|
|
|
265 |
And I select "All participants" from the "Separate groups" singleselect
|
|
|
266 |
And "//tr[contains(@id,'_r7') and contains(.,'Response number')]" "xpath_element" should exist
|
|
|
267 |
And "//tr[contains(@id,'_r8') and contains(@class,'emptyrow')]" "xpath_element" should exist
|