Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_feedback
2
Feature: Anonymous feedback
3
  In order to collect feedbacks
4
  As an admin
5
  I need to be able to allow anonymous feedbacks
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname |
10
      | user1    | Username  | 1        |
11
      | user2    | Username  | 2        |
12
      | teacher  | Teacher   | 3        |
13
      | manager  | Manager   | 4        |
14
    And the following "courses" exist:
15
      | fullname | shortname |
16
      | Course 1 | C1        |
17
    And the following "course enrolments" exist:
18
      | user  | course | role    |
19
      | user1 | C1     | student |
20
      | user2 | C1     | student |
21
      | teacher | C1   | editingteacher |
22
    And the following "system role assigns" exist:
23
      | user    | course               | role    |
24
      | manager | Acceptance test site | manager |
25
    And the following "activities" exist:
26
      | activity   | name            | course               | idnumber  | anonymous | publish_stats | section |
27
      | feedback   | Site feedback   | Acceptance test site | feedback0 | 1         | 1             | 1       |
28
      | feedback   | Course feedback | C1                   | feedback1 | 1         | 1             | 0       |
29
    When I log in as "manager"
30
    And I am on site homepage
31
    And I follow "Site feedback"
32
    And I click on "Edit questions" "link" in the "[role=main]" "css_element"
33
    And I add a "Multiple choice" question to the feedback with:
34
      | Question                       | Do you like our site?              |
35
      | Label                          | multichoice2                       |
36
      | Multiple choice type           | Multiple choice - single answer    |
37
      | Hide the "Not selected" option | Yes                                |
38
      | Multiple choice values         | Yes\nNo\nI don't know              |
39
    And I log out
40
 
41
  Scenario: Guests can see anonymous feedback on front page but can not complete
42
    When I follow "Site feedback"
43
    Then I should not see "Answer the questions"
44
    And I should not see "Preview questions"
45
 
46
  Scenario: Complete anonymous feedback on the front page as an authenticated user
47
    And I log in as "user1"
48
    And I am on site homepage
49
    When I follow "Site feedback"
50
    And I should not see "Preview questions"
51
    And I follow "Answer the questions"
52
    And I should see "Do you like our site?"
53
    And I set the following fields to these values:
54
      | Yes | 1 |
55
    And I press "Submit your answers"
56
    And I should not see "Analysis"
57
    And I press "Continue"
58
 
59
  @javascript
60
  Scenario: Complete anonymous feedback and view analysis on the front page as an authenticated user
61
    Given the following "role capability" exists:
62
      | role                         | frontpage |
63
      | mod/feedback:viewanalysepage | allow     |
64
    And I log in as "user1"
65
    And I am on site homepage
66
    When I follow "Site feedback"
67
    And I should not see "Preview questions"
68
    And I follow "Answer the questions"
69
    And I should see "Do you like our site?"
70
    And I set the following fields to these values:
71
      | Yes | 1 |
72
    And I press "Submit your answers"
73
    And I log out
74
    And I log in as "user2"
75
    And I am on site homepage
76
    And I follow "Site feedback"
77
    And I should not see "Preview questions"
78
    And I follow "Answer the questions"
79
    And I set the following fields to these values:
80
      | No | 1 |
81
    And I press "Submit your answers"
82
    And I follow "Analysis"
83
    And I should see "Submitted answers: 2"
84
    And I should see "Questions: 1"
85
    # And I should not see "multichoice2" # TODO MDL-29303 do not show labels to users who can not edit feedback
86
    And I show chart data for the "multichoice2" feedback
87
    And I should see "Do you like our site?"
88
    And I should see "1 (50.00 %)" in the "Yes" "table_row"
89
    And I should see "1 (50.00 %)" in the "No" "table_row"
90
    And I log out
91
    And I log in as "manager"
92
    And I am on site homepage
93
    And I follow "Site feedback"
94
    And I navigate to "Responses" in current page administration
95
    And I should not see "Username"
96
    And I should see "Anonymous entries (2)"
97
    And I follow "Response number: 1"
98
    And I should not see "Username"
99
    And I should see "Response number: 1 (Anonymous)"
100
    And I log out
101
 
102
  Scenario: Complete fully anonymous feedback on the front page as a guest
103
    Given the following config values are set as admin:
104
      | feedback_allowfullanonymous | 1 |
105
    When I follow "Site feedback"
106
    And I should not see "Preview questions"
107
    And I follow "Answer the questions"
108
    And I should see "Do you like our site?"
109
    And I set the following fields to these values:
110
      | Yes | 1 |
111
    And I press "Submit your answers"
112
    And I should not see "Analysis"
113
    And I press "Continue"
114
 
115
  @javascript
116
  Scenario: Complete fully anonymous feedback and view analyze on the front page as a guest
117
    Given the following config values are set as admin:
118
      | feedback_allowfullanonymous | 1 |
119
    And the following "role capability" exists:
120
      | role                         | guest |
121
      | mod/feedback:viewanalysepage | allow |
122
    When I follow "Site feedback"
123
    And I should not see "Preview questions"
124
    And I follow "Answer the questions"
125
    And I should see "Do you like our site?"
126
    And I set the following fields to these values:
127
      | Yes | 1 |
128
    And I press "Submit your answers"
129
    And I press "Continue"
130
    # Starting new feedback
131
    When I follow "Site feedback"
132
    And I should not see "Preview questions"
133
    And I follow "Answer the questions"
134
    And I should see "Do you like our site?"
135
    And I set the following fields to these values:
136
      | No | 1 |
137
    And I press "Submit your answers"
138
    And I follow "Analysis"
139
    And I should see "Submitted answers: 2"
140
    And I should see "Questions: 1"
141
    # And I should not see "multichoice2" # TODO MDL-29303
142
    And I show chart data for the "multichoice2" feedback
143
    And I should see "Do you like our site?"
144
    And I should see "1 (50.00 %)" in the "Yes" "table_row"
145
    And I should see "1 (50.00 %)" in the "No" "table_row"
146
    And I log in as "manager"
147
    And I am on site homepage
148
    And I follow "Site feedback"
149
    And I navigate to "Responses" in current page administration
150
    And I should see "Anonymous entries (2)"
151
    And I follow "Response number: 1"
152
    And I should see "Response number: 1 (Anonymous)"
153
    And I log out
154
 
155
  @javascript
156
  Scenario: Anonymous feedback in a course
157
    # Teacher can not
158
    When I am on the "Course feedback" "feedback activity" page logged in as teacher
159
    And I click on "Edit questions" "link" in the "[role=main]" "css_element"
160
    And I add a "Multiple choice" question to the feedback with:
161
      | Question                       | Do you like this course?           |
162
      | Label                          | multichoice1                       |
163
      | Multiple choice type           | Multiple choice - single answer    |
164
      | Hide the "Not selected" option | Yes                                |
165
      | Multiple choice values         | Yes\nNo\nI don't know              |
166
    And I log out
167
 
168
    And I am on the "Course feedback" "feedback activity" page logged in as user1
169
    And I should not see "Preview questions"
170
    And I follow "Answer the questions"
171
    And I should see "Do you like this course?"
172
    And I set the following fields to these values:
173
      | Yes | 1 |
174
    And I press "Submit your answers"
175
    And I log out
176
    And I am on the "Course feedback" "feedback activity" page logged in as user2
177
    And I should not see "Preview questions"
178
    And I follow "Answer the questions"
179
    And I should see "Do you like this course?"
180
    And I set the following fields to these values:
181
      | No | 1 |
182
    And I press "Submit your answers"
183
    And I follow "Analysis"
184
    And I should see "Submitted answers: 2"
185
    And I should see "Questions: 1"
186
    # And I should not see "multichoice2" # TODO MDL-29303
187
    And I show chart data for the "multichoice1" feedback
188
    And I should see "Do you like this course?"
189
    And I should see "1 (50.00 %)" in the "Yes" "table_row"
190
    And I should see "1 (50.00 %)" in the "No" "table_row"
191
    And I log out
192
    And I am on the "Course feedback" "feedback activity" page logged in as teacher
193
    And I follow "Preview"
194
    And I should see "Do you like this course?"
195
    And I press "Continue"
196
    And I should not see "Answer the questions"
197
    And I navigate to "Responses" in current page administration
198
    And I should not see "Username"
199
    And I should see "Anonymous entries (2)"
200
    And I follow "Response number: 1"
201
    And I should not see "Username"
202
    And I should see "Response number: 1 (Anonymous)"
203
    And I should not see "Prev"
204
    And I follow "Next"
205
    And I should see "Response number: 2 (Anonymous)"
206
    And I should see "Prev"
207
    And I should not see "Next"
208
    And I click on "Back" "link" in the "[role=main]" "css_element"
209
    # Delete anonymous response
210
    And I click on "Delete entry" "link" in the "Response number: 1" "table_row"
211
    And I press "Yes"
212
    And I should see "Anonymous entries (1)"
213
    And I should not see "Response number: 1"
214
    And I should see "Response number: 2"
215
 
216
  Scenario: Collecting new non-anonymous feedback from a previously anonymous feedback activity
217
    When I am on the "Course feedback" "feedback activity" page logged in as teacher
218
    And I navigate to "Settings" in current page administration
219
    And I set the following fields to these values:
220
      | Allow multiple submissions | Yes |
221
    And I press "Save and display"
222
    And I follow "Edit questions"
223
    And I add a "Short text answer" question to the feedback with:
224
      | Question               | this is a short text answer |
225
      | Label                  | shorttext                   |
226
      | Maximum characters accepted | 200                    |
227
    And I log out
228
    When I am on the "Course feedback" "feedback activity" page logged in as user1
229
    And I follow "Answer the questions"
230
    And I set the following fields to these values:
231
      | this is a short text answer  | anontext |
232
    And I press "Submit your answers"
233
    And I log out
234
    # Switch to non-anon responses.
235
    And I am on the "Course feedback" "feedback activity editing" page logged in as teacher
236
    And I set the following fields to these values:
237
        | Record user names | User's name will be logged and shown with answers |
238
    And I press "Save and display"
239
    And I log out
240
    # Now leave a non-anon feedback as user1
241
    And I am on the "Course feedback" "feedback activity" page logged in as user1
242
    And I follow "Answer the questions"
243
    And I set the following fields to these values:
244
      | this is a short text answer  | usertext |
245
    And I press "Submit your answers"
246
    And I log out
247
    # Now check the responses are correct.
248
    And I am on the "Course feedback" "feedback activity" page logged in as teacher
249
    And I follow "Responses"
250
    And I should see "Anonymous entries (1)"
251
    And I should see "Non anonymous entries (1)"
252
    And I click on "," "link" in the "Username 1" "table_row"
253
    And I should see "(Username 1)"
11 efrain 254
    Then the field "this is a short text answer" matches value "usertext"
1 efrain 255
    And I navigate to "Responses" in current page administration
256
    And I follow "Response number: 1"
257
    And I should see "Response number: 1 (Anonymous)"
11 efrain 258
    And the field "this is a short text answer" matches value "anontext"