2 Feature: Non anonymous feedback
3 In order to collect feedbacks
5 I need to be able to create and collect feedbacks
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 |
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 | 2 | 1 | 1 |
28 | feedback | Course feedback | C1 | feedback1 | 2 | 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 of course\nNot at all\nI don't know |
41 Scenario: Guests can see non 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 follow "Preview"
45 And I should see "Do you like our site?"
46 And I press "Continue"
48 Scenario: Complete non anonymous feedback on the front page as an authenticated user
49 And I log in as "user1"
50 And I am on site homepage
51 And I follow "Site feedback"
52 And I follow "Preview"
53 And I should see "Do you like our site?"
54 And I press "Continue"
55 And I follow "Answer the questions"
56 And I should see "Do you like our site?"
57 And I set the following fields to these values:
59 And I press "Submit your answers"
60 And I should not see "Submitted answers"
61 And I press "Continue"
64 Scenario: Complete non anonymous feedback and view analysis on the front page as an authenticated user
65 And I log in as "admin"
66 And I set the following system permissions of "Authenticated user on frontpage" role:
67 | capability | permission |
68 | mod/feedback:viewanalysepage | Allow |
70 And I log in as "user1"
71 And I am on site homepage
72 When I follow "Site feedback"
73 And I follow "Answer the questions"
74 And I should see "Do you like our site?"
75 And I set the following fields to these values:
77 And I press "Submit your answers"
79 And I log in as "user2"
80 And I am on site homepage
81 When I follow "Site feedback"
82 And I follow "Answer the questions"
83 And I set the following fields to these values:
85 And I press "Submit your answers"
86 And I follow "Submitted answers"
87 And I should see "Submitted answers: 2"
88 And I should see "Questions: 1"
89 # And I should not see "multichoice2" # TODO MDL-29303 do not show labels to users who can not edit feedback
90 And I show chart data for the "multichoice2" feedback
91 And I should see "Do you like our site?"
92 And I should see "1 (50.00 %)" in the "Yes of course" "table_row"
93 And I should see "1 (50.00 %)" in the "Not at all" "table_row"
94 And I should not see "Show responses"
96 And I log in as "manager"
97 And I am on site homepage
98 And I follow "Site feedback"
99 And I navigate to "Show responses" in current page administration
100 And I should see "Username"
101 And I should see "Non anonymous entries (2)"
102 And I should not see "Anonymous entries"
103 And I click on "," "link" in the "Username 1" "table_row"
104 And I should see "(Username 1)"
105 And I should see "Yes of course"
110 Scenario: Non anonymous feedback in a course
111 When I log in as "teacher"
112 And I am on "Course 1" course homepage
113 And I follow "Course feedback"
114 And I click on "Edit questions" "link" in the "[role=main]" "css_element"
115 And I add a "Multiple choice" question to the feedback with:
116 | Question | Do you like this course? |
117 | Label | multichoice1 |
118 | Multiple choice type | Multiple choice - single answer |
119 | Hide the "Not selected" option | Yes |
120 | Multiple choice values | Yes of course\nNot at all\nI don't know |
122 And I log in as "user1"
123 And I am on "Course 1" course homepage
124 And I follow "Course feedback"
125 And I follow "Answer the questions"
126 And I should see "Do you like this course?"
127 And I set the following fields to these values:
128 | Yes of course | 1 |
129 And I press "Submit your answers"
131 And I log in as "user2"
132 And I am on "Course 1" course homepage
133 And I follow "Course feedback"
134 And I follow "Answer the questions"
135 And I should see "Do you like this course?"
136 And I set the following fields to these values:
138 And I press "Submit your answers"
139 And I follow "Submitted answers"
140 And I should see "Submitted answers: 2"
141 And I should see "Questions: 1"
142 # And I should not see "multichoice2" # TODO MDL-29303
143 And I show chart data for the "multichoice1" feedback
144 And I should see "Do you like this course?"
145 And I should see "1 (50.00 %)" in the "Yes of course" "table_row"
146 And I should see "1 (50.00 %)" in the "Not at all" "table_row"
148 And I log in as "teacher"
149 And I am on "Course 1" course homepage
150 And I follow "Course feedback"
151 And I follow "Preview"
152 And I should see "Do you like this course?"
153 And I press "Continue"
154 And I should not see "Answer the questions"
155 And I navigate to "Show responses" in current page administration
156 And I should see "Non anonymous entries (2)"
157 And I should not see "Anonymous"
158 And I click on "," "link" in the "Username 1" "table_row"
159 And I should see "(Username 1)"
160 And I should see "Yes of course"
161 And I should not see "Prev"
163 And I should see "(Username 2)"
164 And I should not see "Next"
165 And I should see "Prev"
166 And I click on "Back" "link" in the "region-main" "region"
167 # Delete non anonymous response
168 And I click on "Delete entry" "link" in the "Username 1" "table_row"
170 And I should see "Non anonymous entries (1)"
171 And I should not see "Username 1"
172 And I should see "Username 2"