Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_feedback
2
Feature: Mapping courses in a feedback
3
  In order to collect the same feedback about multiple courses
4
  As a manager
5
  I need to be able to map site feedback to courses
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
      | teacher  | Teacher   | 4        |
14
      | manager  | Manager   | 5        |
15
    And the following "courses" exist:
16
      | fullname | shortname |
17
      | Course 1 | C1        |
18
      | Course 2 | C2        |
19
      | Course 3 | C3        |
20
    And the following "course enrolments" exist:
21
      | user    | course | role    |
22
      | user1   | C1     | student |
23
      | user1   | C2     | student |
24
      | user2   | C1     | student |
25
      | user2   | C2     | student |
26
      | user3   | C3     | student |
27
      | teacher | C1     | editingteacher |
28
      | teacher | C2     | editingteacher |
29
      | teacher | C3     | editingteacher |
30
    And the following "system role assigns" exist:
31
      | user    | course               | role    |
32
      | manager | Acceptance test site | manager |
33
    And the following "activities" exist:
34
      | activity   | name             | course               | idnumber  | anonymous | publish_stats | section |
35
      | feedback   | Course feedback  | Acceptance test site | feedback0 | 1         | 1             | 1       |
36
      | feedback   | Another feedback | C1                   | feedback1 | 1         | 1             | 0       |
37
    And I enable "feedback" "block" plugin
38
    And the following "blocks" exist:
39
      | blockname | contextlevel | reference | pagetypepattern | defaultregion |
40
      | feedback  | Course       | C1        | course-view-*   | side-pre      |
41
      | feedback  | Course       | C2        | course-view-*   | side-pre      |
42
      | feedback  | Course       | C3        | course-view-*   | side-pre      |
43
    When I log in as "manager"
44
    And I am on site homepage
45
    And I follow "Course feedback"
46
    And I click on "Edit questions" "link" in the "[role=main]" "css_element"
47
    And I add a "Information" question to the feedback with:
48
      | Question         | this is an information question |
49
      | Label            | info                            |
50
      | Information type | Course                          |
51
    And I add a "Multiple choice (rated)" question to the feedback with:
52
      | Question               | this is a multiple choice rated    |
53
      | Label                  | multichoicerated                   |
54
      | Multiple choice type   | Multiple choice - single answer    |
55
      | Multiple choice values | 0/option a\n1/option b\n5/option c |
56
    And I add a "Multiple choice" question to the feedback with:
57
      | Question               | this is a simple multiple choice    |
58
      | Label                  | multichoicesimple                   |
59
      | Multiple choice type   | Multiple choice - single answer allowed (drop-down menu) |
60
      | Multiple choice values | option d\noption e\noption f                           |
61
    And I log out
62
 
63
  Scenario: Course feedback can not be mapped
64
    And I log in as "manager"
65
    And I am on "Course 1" course homepage
66
    And I follow "Another feedback"
67
    And I should not see "Mapped courses"
68
 
69
  @javascript
70
  Scenario: Site feedback is not mapped to any course
71
    And I log in as "user1"
72
    And I am on site homepage
73
    And I follow "Course feedback"
74
    And I follow "Answer the questions"
75
    And I should see "Acceptance test site" in the ".feedback_form" "css_element"
76
    And I set the following fields to these values:
77
      | option a                         | 1        |
78
      | this is a simple multiple choice | option d |
79
    And I press "Submit your answers"
80
    And I press "Continue"
81
    And I am on "Course 1" course homepage
82
    And I click on "Course feedback" "link" in the "Feedback" "block"
83
    And I follow "Answer the questions"
84
    And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
85
    And I should see "C1" in the ".feedback_form" "css_element"
86
    And I set the following fields to these values:
87
      | option b                         | 1        |
88
      | this is a simple multiple choice | option e |
89
    And I press "Submit your answers"
90
    And I press "Continue"
91
    And I click on "Course feedback" "link" in the "Feedback" "block"
92
    And I should not see "Answer the questions"
93
    And I log out
94
    And I log in as "user2"
95
    And I am on "Course 1" course homepage
96
    And I click on "Course feedback" "link" in the "Feedback" "block"
97
    And I follow "Answer the questions"
98
    And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
99
    And I should see "C1" in the ".feedback_form" "css_element"
100
    And I set the following fields to these values:
101
      | option c                         | 1        |
102
      | this is a simple multiple choice | option e |
103
    And I press "Submit your answers"
104
    And I press "Continue"
105
    And I log out
106
    And I log in as "manager"
107
    And I am on site homepage
108
    And I follow "Course feedback"
109
 
110
    And I navigate to "Analysis" in current page administration
111
    And I should see "All courses" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=option]" "css_element"
112
    And I show chart data for the "multichoicerated" feedback
113
    And I should see "1 (33.33 %)" in the "option a" "table_row"
114
    And I should see "1 (33.33 %)" in the "option b" "table_row"
115
    And I should see "1 (33.33 %)" in the "option c" "table_row"
116
    And I should see "Average: 2.00"
117
    And I follow "Sort by course"
118
    And I should see "2.50" in the "C1" "table_row"
119
    And I should see "1.00" in the "Acceptance test site" "table_row"
120
    And I click on "Back" "link" in the "region-main" "region"
121
    And I set the field "Filter by course" to "Course 1"
122
    And I press "Filter"
123
    And I should see "Course 1" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=option]" "css_element"
124
    And I show chart data for the "multichoicerated" feedback
125
    And I should see "0" in the "option a" "table_row"
126
    And I should see "1 (50.00 %)" in the "option b" "table_row"
127
    And I should see "1 (50.00 %)" in the "option c" "table_row"
128
    And I log out
129
 
130
  @javascript
131
  Scenario: Site feedback is mapped to courses
132
    And I log in as "manager"
133
    And I am on site homepage
134
    And I follow "Course feedback"
135
    And I follow "Mapped courses"
136
    And I set the field "Courses" to "Course 2, Course 3"
137
    And I press "Save changes"
138
    And I should see "Course mapping has been changed"
139
    And I log out
140
 
141
    And I log in as "user1"
142
    And I am on site homepage
143
    And I follow "Course feedback"
144
    And I should see "You can only access this feedback from a course"
145
    And I should not see "Answer the questions"
146
 
147
    And I am on "Course 1" course homepage
148
    And "Feedback" "block" should not exist
149
    And I should not see "Course feedback"
150
 
151
    And I am on "Course 2" course homepage
152
    And I click on "Course feedback" "link" in the "Feedback" "block"
153
    And I follow "Answer the questions"
154
    And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
155
    And I should see "C2" in the ".feedback_form" "css_element"
156
    And I set the following fields to these values:
157
      | option b                         | 1        |
158
      | this is a simple multiple choice | option e |
159
    And I press "Submit your answers"
160
    And I press "Continue"
161
    And I click on "Course feedback" "link" in the "Feedback" "block"
162
    And I should not see "Answer the questions"
163
    And I log out
164
    And I log in as "user2"
165
    And I am on "Course 2" course homepage
166
    And I click on "Course feedback" "link" in the "Feedback" "block"
167
    And I follow "Answer the questions"
168
    And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
169
    And I should see "C2" in the ".feedback_form" "css_element"
170
    And I set the following fields to these values:
171
      | option c                         | 1        |
172
      | this is a simple multiple choice | option e |
173
    And I press "Submit your answers"
174
    And I press "Continue"
175
    And I log out
176
    And I log in as "user3"
177
    And I am on "Course 3" course homepage
178
    And I click on "Course feedback" "link" in the "Feedback" "block"
179
    And I follow "Answer the questions"
180
    And I should not see "Acceptance test site" in the ".feedback_form" "css_element"
181
    And I should see "C3" in the ".feedback_form" "css_element"
182
    And I set the following fields to these values:
183
      | option c                         | 1        |
184
      | this is a simple multiple choice | option d |
185
    And I press "Submit your answers"
186
    And I press "Continue"
187
    And I log out
188
    And I log in as "manager"
189
    And I am on site homepage
190
    And I follow "Course feedback"
191
    And I navigate to "Analysis" in current page administration
192
    And I should see "All courses" in the "#feedback_course_filter [data-fieldtype=autocomplete] .form-autocomplete-selection [role=option]" "css_element"
193
    And I show chart data for the "multichoicerated" feedback
194
    And I should see "0" in the "option a" "table_row"
195
    And I should see "1 (33.33 %)" in the "option b" "table_row"
196
    And I should see "2 (66.67 %)" in the "option c" "table_row"
197
    And I should see "Average: 3.67"
198
    And I click on "Sort by course" "link"
199
    And I should see "3.00" in the "C3" "table_row"
200
    And I should see "2.50" in the "C2" "table_row"
201
    And I click on "Back" "link" in the "region-main" "region"
202
    And I set the field "Filter by course" to "Course 2"
203
    And I press "Filter"
204
    And I show chart data for the "multichoicerated" feedback
205
    And I should see "0" in the "option a" "table_row"
206
    And I should see "1 (50.00 %)" in the "option b" "table_row"
207
    And I should see "1 (50.00 %)" in the "option c" "table_row"
208
    And I show chart data for the "multichoicesimple" feedback
209
    And I should see "2 (100.00 %)" in the "option e" "table_row"
210
    And I set the field "Filter by course" to "Course 3"
211
    And I press "Filter"
212
    And I show chart data for the "multichoicerated" feedback
213
    And I should see "0" in the "option a" "table_row"
214
    And I should see "0" in the "option b" "table_row"
215
    And I should see "1 (100.00 %)" in the "option c" "table_row"
216
    And I show chart data for the "multichoicesimple" feedback
217
    And I should see "1 (100.00 %)" in the "option d" "table_row"
218
    And I follow "Show all"
219
    And I show chart data for the "multichoicesimple" feedback
220
    And I should see "1 (33.33 %)" in the "option d" "table_row"
221
    And I should see "2 (66.67 %)" in the "option e" "table_row"
222
    And I should see "0" in the "option f" "table_row"
223
 
224
  Scenario: Site feedback deletion hides feedback block completely
225
    When I log in as "manager"
226
    And I am on site homepage
227
    And I turn editing mode on
228
    And I add the "Feedback" block
229
    And I add the "Main menu" block
230
    And I click on "Delete" "link" in the "Course feedback" activity
231
    And I press "Yes"
232
    And I turn editing mode off
233
    And I am on site homepage
234
    Then "Feedback" "block" should not exist
235
    And I am on "Course 1" course homepage
236
    And "Feedback" "block" should not exist