1 |
efrain |
1 |
@mod @mod_feedback
|
|
|
2 |
Feature: Non anonymous feedback
|
|
|
3 |
In order to collect feedbacks
|
|
|
4 |
As an teacher
|
|
|
5 |
I need to be able to create and collect 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 | 2 | 1 | 1 |
|
|
|
28 |
| feedback | Course feedback | C1 | feedback1 | 2 | 1 | 0 |
|
|
|
29 |
When I am on the "Site feedback" "feedback activity" page logged in as manager
|
|
|
30 |
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
|
|
|
31 |
And I add a "Multiple choice" question to the feedback with:
|
|
|
32 |
| Question | Do you like our site? |
|
|
|
33 |
| Label | multichoice2 |
|
|
|
34 |
| Multiple choice type | Multiple choice - single answer |
|
|
|
35 |
| Hide the "Not selected" option | Yes |
|
|
|
36 |
| Multiple choice values | Yes of course\nNot at all\nI don't know |
|
|
|
37 |
And I log out
|
|
|
38 |
|
|
|
39 |
Scenario: Guests can see non anonymous feedback on front page but can not complete
|
|
|
40 |
When I am on the "Site feedback" "feedback activity" page
|
|
|
41 |
Then I should not see "Answer the questions"
|
|
|
42 |
And I should not see "Preview questions"
|
|
|
43 |
|
|
|
44 |
Scenario: Complete non anonymous feedback on the front page as an authenticated user
|
|
|
45 |
When I am on the "Site feedback" "feedback activity" page logged in as user1
|
|
|
46 |
And I should not see "Preview questions"
|
|
|
47 |
And I follow "Answer the questions"
|
|
|
48 |
And I should see "Do you like our site?"
|
|
|
49 |
And I set the following fields to these values:
|
|
|
50 |
| Yes of course | 1 |
|
|
|
51 |
And I press "Submit your answers"
|
|
|
52 |
And I should not see "Analysis"
|
|
|
53 |
And I press "Continue"
|
|
|
54 |
|
|
|
55 |
@javascript
|
|
|
56 |
Scenario: Complete non anonymous feedback and view analysis on the front page as an authenticated user
|
|
|
57 |
Given the following "role capability" exists:
|
|
|
58 |
| role | frontpage |
|
|
|
59 |
| mod/feedback:viewanalysepage | allow |
|
|
|
60 |
When I am on the "Site feedback" "feedback activity" page logged in as user1
|
|
|
61 |
And I follow "Answer the questions"
|
|
|
62 |
And I should see "Do you like our site?"
|
|
|
63 |
And I set the following fields to these values:
|
|
|
64 |
| Yes of course | 1 |
|
|
|
65 |
And I press "Submit your answers"
|
|
|
66 |
And I log out
|
|
|
67 |
And I am on the "Site feedback" "feedback activity" page logged in as user2
|
|
|
68 |
And I follow "Answer the questions"
|
|
|
69 |
And I set the following fields to these values:
|
|
|
70 |
| Not at all | 1 |
|
|
|
71 |
And I press "Submit your answers"
|
|
|
72 |
And I follow "Analysis"
|
|
|
73 |
And I should see "Submitted answers: 2"
|
|
|
74 |
And I should see "Questions: 1"
|
|
|
75 |
# And I should not see "multichoice2" # TODO MDL-29303 do not show labels to users who can not edit feedback
|
|
|
76 |
And I show chart data for the "multichoice2" feedback
|
|
|
77 |
And I should see "Do you like our site?"
|
|
|
78 |
And I should see "1 (50.00 %)" in the "Yes of course" "table_row"
|
|
|
79 |
And I should see "1 (50.00 %)" in the "Not at all" "table_row"
|
|
|
80 |
And I log out
|
|
|
81 |
And I am on the "Site feedback" "feedback activity" page logged in as manager
|
|
|
82 |
And I navigate to "Responses" in current page administration
|
|
|
83 |
And I should see "Username"
|
|
|
84 |
And I should see "Non anonymous entries (2)"
|
|
|
85 |
And I should not see "Anonymous entries"
|
|
|
86 |
And I click on "," "link" in the "Username 1" "table_row"
|
|
|
87 |
And I should see "(Username 1)"
|
|
|
88 |
And I should see "Yes of course"
|
|
|
89 |
And I log out
|
|
|
90 |
|
|
|
91 |
@javascript
|
|
|
92 |
Scenario: Non anonymous feedback in a course
|
|
|
93 |
When I am on the "Course feedback" "feedback activity" page logged in as teacher
|
|
|
94 |
And I click on "Edit questions" "link" in the "[role=main]" "css_element"
|
|
|
95 |
And I add a "Multiple choice" question to the feedback with:
|
|
|
96 |
| Question | Do you like this course? |
|
|
|
97 |
| Label | multichoice1 |
|
|
|
98 |
| Multiple choice type | Multiple choice - single answer |
|
|
|
99 |
| Hide the "Not selected" option | Yes |
|
|
|
100 |
| Multiple choice values | Yes of course\nNot at all\nI don't know |
|
|
|
101 |
And I log out
|
|
|
102 |
When I am on the "Course feedback" "feedback activity" page logged in as user1
|
|
|
103 |
And I follow "Answer the questions"
|
|
|
104 |
And I should see "Do you like this course?"
|
|
|
105 |
And I set the following fields to these values:
|
|
|
106 |
| Yes of course | 1 |
|
|
|
107 |
And I press "Submit your answers"
|
|
|
108 |
And I log out
|
|
|
109 |
When I am on the "Course feedback" "feedback activity" page logged in as user2
|
|
|
110 |
And I follow "Answer the questions"
|
|
|
111 |
And I should see "Do you like this course?"
|
|
|
112 |
And I set the following fields to these values:
|
|
|
113 |
| Not at all | 1 |
|
|
|
114 |
And I press "Submit your answers"
|
|
|
115 |
And I follow "Analysis"
|
|
|
116 |
And I should see "Submitted answers: 2"
|
|
|
117 |
And I should see "Questions: 1"
|
|
|
118 |
# And I should not see "multichoice2" # TODO MDL-29303
|
|
|
119 |
And I show chart data for the "multichoice1" feedback
|
|
|
120 |
And I should see "Do you like this course?"
|
|
|
121 |
And I should see "1 (50.00 %)" in the "Yes of course" "table_row"
|
|
|
122 |
And I should see "1 (50.00 %)" in the "Not at all" "table_row"
|
|
|
123 |
And I log out
|
|
|
124 |
When I am on the "Course feedback" "feedback activity" page logged in as teacher
|
|
|
125 |
And I follow "Preview"
|
|
|
126 |
And I should see "Do you like this course?"
|
|
|
127 |
And I press "Continue"
|
|
|
128 |
And I should not see "Answer the questions"
|
|
|
129 |
And I navigate to "Responses" in current page administration
|
|
|
130 |
And I should see "Non anonymous entries (2)"
|
|
|
131 |
And I should not see "Anonymous"
|
|
|
132 |
And I click on "," "link" in the "Username 1" "table_row"
|
|
|
133 |
And I should see "(Username 1)"
|
|
|
134 |
And I should see "Yes of course"
|
|
|
135 |
And I should not see "Prev"
|
|
|
136 |
And I follow "Next"
|
|
|
137 |
And I should see "(Username 2)"
|
|
|
138 |
And I should not see "Next"
|
|
|
139 |
And I should see "Prev"
|
|
|
140 |
And I click on "Back" "link" in the "region-main" "region"
|
|
|
141 |
# Sort the feedback responses.
|
|
|
142 |
And I click on "Do you like this course?" "link" in the "generaltable" "table"
|
|
|
143 |
And "Username 1" "table_row" should appear before "Username 2" "table_row"
|
|
|
144 |
# Now sort descending.
|
|
|
145 |
And I click on "Do you like this course?" "link" in the "generaltable" "table"
|
|
|
146 |
And "Username 2" "table_row" should appear before "Username 1" "table_row"
|
|
|
147 |
# Delete non anonymous response
|
|
|
148 |
And I click on "Delete entry" "link" in the "Username 1" "table_row"
|
|
|
149 |
And I press "Yes"
|
|
|
150 |
And I should see "Non anonymous entries (1)"
|
|
|
151 |
And I should not see "Username 1"
|
|
|
152 |
And I should see "Username 2"
|