1 |
efrain |
1 |
@mod @mod_lesson
|
|
|
2 |
Feature: In a lesson activity, teacher can create lesson's pages
|
|
|
3 |
In order to set up an existing lesson
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to create pages in the lesson
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "activities" exist:
|
|
|
20 |
| activity | name | course | idnumber |
|
|
|
21 |
| lesson | Test lesson name | C1 | lesson1 |
|
|
|
22 |
|
|
|
23 |
Scenario: Create content page
|
|
|
24 |
When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
|
|
|
25 |
And I follow "Add a content page"
|
|
|
26 |
And I set the following fields to these values:
|
|
|
27 |
| Page title | First page name |
|
|
|
28 |
| Page contents | First page contents |
|
|
|
29 |
| id_answer_editor_0 | Forward |
|
|
|
30 |
| id_jumpto_0 | Next page |
|
|
|
31 |
| id_answer_editor_1 | Backward |
|
|
|
32 |
| id_jumpto_1 | Previous page |
|
|
|
33 |
And I press "Save page"
|
|
|
34 |
And I select edit type "Expanded"
|
|
|
35 |
Then I should see "First page name"
|
|
|
36 |
And I should see "First page contents"
|
|
|
37 |
And I should see "Forward" in the "Content 1" "table_row"
|
|
|
38 |
And I should see "Next page" in the "Jump 1" "table_row"
|
|
|
39 |
And I should see "Backward" in the "Content 2" "table_row"
|
|
|
40 |
And I should see "Previous page" in the "Jump 2" "table_row"
|
|
|
41 |
|
|
|
42 |
Scenario: Create essay page
|
|
|
43 |
When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
|
|
|
44 |
And I follow "Add a question page"
|
|
|
45 |
And I set the field "Select a question type" to "Essay"
|
|
|
46 |
And I press "Add a question page"
|
|
|
47 |
And I set the following fields to these values:
|
|
|
48 |
| Page title | Music essay |
|
|
|
49 |
| Page contents | Write a really interesting music essay |
|
|
|
50 |
| Jump | End of lesson |
|
|
|
51 |
| Score | 1 |
|
|
|
52 |
And I press "Save page"
|
|
|
53 |
And I select edit type "Expanded"
|
|
|
54 |
Then I should see "Music essay"
|
|
|
55 |
And I should see "Write a really interesting music essay"
|
|
|
56 |
And I should see "End of lesson" in the "Jump 1" "table_row"
|
|
|
57 |
|
|
|
58 |
Scenario: Create matching page
|
|
|
59 |
When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
|
|
|
60 |
And I follow "Add a question page"
|
|
|
61 |
And I set the field "Select a question type" to "Matching"
|
|
|
62 |
And I press "Add a question page"
|
|
|
63 |
And I set the following fields to these values:
|
|
|
64 |
| Page title | Geography |
|
|
|
65 |
| Page contents | Match each city with its country |
|
|
|
66 |
| id_answer_editor_0 | Correct! |
|
|
|
67 |
| id_jumpto_0 | End of lesson |
|
|
|
68 |
| id_score_0 | 2 |
|
|
|
69 |
| id_answer_editor_1 | Wrong! |
|
|
|
70 |
| id_jumpto_1 | This page |
|
|
|
71 |
| id_score_1 | 0 |
|
|
|
72 |
| id_answer_editor_2 | Barcelona |
|
|
|
73 |
| id_response_editor_2 | Spain |
|
|
|
74 |
| id_answer_editor_3 | Perth |
|
|
|
75 |
| id_response_editor_3 | Australia |
|
|
|
76 |
| id_answer_editor_4 | Tokyo |
|
|
|
77 |
| id_response_editor_4 | Japan |
|
|
|
78 |
| id_answer_editor_5 | Buenos Aires |
|
|
|
79 |
| id_response_editor_5 | Argentina |
|
|
|
80 |
| id_answer_editor_6 | Cairo |
|
|
|
81 |
| id_response_editor_6 | Egypt |
|
|
|
82 |
And I press "Save page"
|
|
|
83 |
And I select edit type "Expanded"
|
|
|
84 |
Then I should see "Geography"
|
|
|
85 |
And I should see "Match each city with its country"
|
|
|
86 |
And I should see "Correct!" in the "Correct response" "table_row"
|
|
|
87 |
And I should see "2" in the "Correct answer score" "table_row"
|
|
|
88 |
And I should see "End of lesson" in the "Correct answer jump" "table_row"
|
|
|
89 |
And I should see "Wrong!" in the "Wrong response" "table_row"
|
|
|
90 |
And I should see "0" in the "Wrong answer score" "table_row"
|
|
|
91 |
And I should see "This page" in the "Wrong answer jump" "table_row"
|
|
|
92 |
And I should see "Barcelona" in the "Answer 1" "table_row"
|
|
|
93 |
And I should see "Spain" in the "Matches with answer 1" "table_row"
|
|
|
94 |
And I should see "Perth" in the "Answer 2" "table_row"
|
|
|
95 |
And I should see "Australia" in the "Matches with answer 2" "table_row"
|
|
|
96 |
And I should see "Tokyo" in the "Answer 3" "table_row"
|
|
|
97 |
And I should see "Japan" in the "Matches with answer 3" "table_row"
|
|
|
98 |
And I should see "Buenos Aires" in the "Answer 4" "table_row"
|
|
|
99 |
And I should see "Argentina" in the "Matches with answer 4" "table_row"
|
|
|
100 |
And I should see "Cairo" in the "Answer 5" "table_row"
|
|
|
101 |
And I should see "Egypt" in the "Matches with answer 5" "table_row"
|
|
|
102 |
|
|
|
103 |
Scenario: Create multichoice page
|
|
|
104 |
When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
|
|
|
105 |
And I follow "Add a question page"
|
|
|
106 |
And I set the field "Select a question type" to "Multichoice"
|
|
|
107 |
And I press "Add a question page"
|
|
|
108 |
And I set the following fields to these values:
|
|
|
109 |
| Page title | Multichoice question |
|
|
|
110 |
| Page contents | What animal is an amphibian? |
|
|
|
111 |
| id_answer_editor_0 | Frog |
|
|
|
112 |
| id_response_editor_0 | Correct answer |
|
|
|
113 |
| id_jumpto_0 | End of lesson |
|
|
|
114 |
| id_score_0 | 2 |
|
|
|
115 |
| id_answer_editor_1 | Cat |
|
|
|
116 |
| id_response_editor_1 | Incorrect answer |
|
|
|
117 |
| id_jumpto_1 | This page |
|
|
|
118 |
| id_score_1 | 0 |
|
|
|
119 |
| id_answer_editor_2 | Dog |
|
|
|
120 |
| id_response_editor_2 | Incorrect answer |
|
|
|
121 |
| id_jumpto_2 | Next page |
|
|
|
122 |
| id_score_2 | 0 |
|
|
|
123 |
And I press "Save page"
|
|
|
124 |
And I select edit type "Expanded"
|
|
|
125 |
Then I should see "Multichoice question"
|
|
|
126 |
And I should see "What animal is an amphibian?"
|
|
|
127 |
And I should see "Frog" in the "Answer 1" "table_row"
|
|
|
128 |
And I should see "Correct answer" in the "Response 1" "table_row"
|
|
|
129 |
And I should see "End of lesson" in the "//tr[contains(.,'Jump')][1]" "xpath_element"
|
|
|
130 |
And I should see "2" in the "//tr[contains(.,'Score')][1]" "xpath_element"
|
|
|
131 |
And I should see "Cat" in the "Answer 2" "table_row"
|
|
|
132 |
And I should see "Incorrect answer" in the "Response 2" "table_row"
|
|
|
133 |
And I should see "This page" in the "//tr[contains(.,'Jump')][2]" "xpath_element"
|
|
|
134 |
And I should see "0" in the "//tr[contains(.,'Score')][2]" "xpath_element"
|
|
|
135 |
And I should see "Dog" in the "Answer 3" "table_row"
|
|
|
136 |
And I should see "Incorrect answer" in the "Response 3" "table_row"
|
|
|
137 |
And I should see "Next page" in the "//tr[contains(.,'Jump')][3]" "xpath_element"
|
|
|
138 |
And I should see "0" in the "//tr[contains(.,'Score')][3]" "xpath_element"
|
|
|
139 |
|
|
|
140 |
Scenario: Create numerical page
|
|
|
141 |
When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
|
|
|
142 |
And I follow "Add a question page"
|
|
|
143 |
And I set the field "Select a question type" to "Numerical"
|
|
|
144 |
And I press "Add a question page"
|
|
|
145 |
And I set the following fields to these values:
|
|
|
146 |
| Page title | Really hard question |
|
|
|
147 |
| Page contents | What is 1 + 2? |
|
|
|
148 |
| id_answer_editor_0 | 3 |
|
|
|
149 |
| id_response_editor_0 | Correct |
|
|
|
150 |
| id_jumpto_0 | End of lesson |
|
|
|
151 |
| id_score_0 | 2 |
|
|
|
152 |
| id_answer_editor_1 | 2 |
|
|
|
153 |
| id_response_editor_1 | Close, but wrong |
|
|
|
154 |
| id_jumpto_1 | Next page |
|
|
|
155 |
| id_score_1 | 1 |
|
|
|
156 |
| id_enableotheranswers | 1 |
|
|
|
157 |
| id_response_editor_6 | Wrong |
|
|
|
158 |
| id_jumpto_6 | This page |
|
|
|
159 |
| id_score_6 | 0 |
|
|
|
160 |
And I press "Save page"
|
|
|
161 |
And I select edit type "Expanded"
|
|
|
162 |
Then I should see "Really hard question"
|
|
|
163 |
And I should see "What is 1 + 2?"
|
|
|
164 |
And I should see "3" in the "Answer 1" "table_row"
|
|
|
165 |
And I should see "Correct" in the "Response 1" "table_row"
|
|
|
166 |
And I should see "End of lesson" in the "//tr[contains(.,'Jump')][1]" "xpath_element"
|
|
|
167 |
And I should see "2" in the "//tr[contains(.,'Score')][1]" "xpath_element"
|
|
|
168 |
And I should see "2" in the "Answer 2" "table_row"
|
|
|
169 |
And I should see "Close, but wrong" in the "Response 2" "table_row"
|
|
|
170 |
And I should see "Next page" in the "//tr[contains(.,'Jump')][2]" "xpath_element"
|
|
|
171 |
And I should see "1" in the "//tr[contains(.,'Score')][2]" "xpath_element"
|
|
|
172 |
And I should see "@#wronganswer#@" in the "Answer 3" "table_row"
|
|
|
173 |
And I should see "Wrong" in the "Response 3" "table_row"
|
|
|
174 |
And I should see "This page" in the "//tr[contains(.,'Jump')][3]" "xpath_element"
|
|
|
175 |
And I should see "0" in the "//tr[contains(.,'Score')][3]" "xpath_element"
|
|
|
176 |
|
|
|
177 |
Scenario: Create short answer page
|
|
|
178 |
When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
|
|
|
179 |
And I follow "Add a question page"
|
|
|
180 |
And I set the field "Select a question type" to "Short answer"
|
|
|
181 |
And I press "Add a question page"
|
|
|
182 |
And I set the following fields to these values:
|
|
|
183 |
| Page title | Geography |
|
|
|
184 |
| Page contents | Capital of Canada |
|
|
|
185 |
| id_answer_editor_0 | Ottawa |
|
|
|
186 |
| id_response_editor_0 | Correct |
|
|
|
187 |
| id_jumpto_0 | End of lesson |
|
|
|
188 |
| id_score_0 | 2 |
|
|
|
189 |
| id_answer_editor_1 | Toronto |
|
|
|
190 |
| id_response_editor_1 | It's in Canada, but it's not the capital |
|
|
|
191 |
| id_jumpto_1 | Next page |
|
|
|
192 |
| id_score_1 | 1 |
|
|
|
193 |
| id_answer_editor_2 | Vancouver |
|
|
|
194 |
| id_response_editor_2 | It's in Canada, but it's not the capital |
|
|
|
195 |
| id_jumpto_2 | Next page |
|
|
|
196 |
| id_score_2 | 1 |
|
|
|
197 |
| id_enableotheranswers | 1 |
|
|
|
198 |
| id_response_editor_6 | Wrong |
|
|
|
199 |
| id_jumpto_6 | This page |
|
|
|
200 |
| id_score_6 | 0 |
|
|
|
201 |
And I press "Save page"
|
|
|
202 |
And I select edit type "Expanded"
|
|
|
203 |
Then I should see "Geography"
|
|
|
204 |
And I should see "Capital of Canada"
|
|
|
205 |
And I should see "Ottawa" in the "Answer 1" "table_row"
|
|
|
206 |
And I should see "Correct" in the "Response 1" "table_row"
|
|
|
207 |
And I should see "End of lesson" in the "//tr[contains(.,'Jump')][1]" "xpath_element"
|
|
|
208 |
And I should see "2" in the "//tr[contains(.,'Score')][1]" "xpath_element"
|
|
|
209 |
And I should see "Toronto" in the "Answer 2" "table_row"
|
|
|
210 |
And I should see "It's in Canada, but it's not the capital" in the "Response 2" "table_row"
|
|
|
211 |
And I should see "Next page" in the "//tr[contains(.,'Jump')][2]" "xpath_element"
|
|
|
212 |
And I should see "1" in the "//tr[contains(.,'Score')][2]" "xpath_element"
|
|
|
213 |
And I should see "Vancouver" in the "Answer 3" "table_row"
|
|
|
214 |
And I should see "It's in Canada, but it's not the capital" in the "Response 3" "table_row"
|
|
|
215 |
And I should see "Next page" in the "//tr[contains(.,'Jump')][3]" "xpath_element"
|
|
|
216 |
And I should see "1" in the "//tr[contains(.,'Score')][3]" "xpath_element"
|
|
|
217 |
And I should see "@#wronganswer#@" in the "Answer 4" "table_row"
|
|
|
218 |
And I should see "Wrong" in the "Response 4" "table_row"
|
|
|
219 |
And I should see "This page" in the "//tr[contains(.,'Jump')][4]" "xpath_element"
|
|
|
220 |
And I should see "0" in the "//tr[contains(.,'Score')][4]" "xpath_element"
|
|
|
221 |
|
|
|
222 |
Scenario: Create true/false page
|
|
|
223 |
When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
|
|
|
224 |
And I follow "Add a question page"
|
|
|
225 |
And I set the field "Select a question type" to "True/false"
|
|
|
226 |
And I press "Add a question page"
|
|
|
227 |
And I set the following fields to these values:
|
|
|
228 |
| Page title | True/false question |
|
|
|
229 |
| Page contents | Paper is made from trees. |
|
|
|
230 |
| id_answer_editor_0 | True |
|
|
|
231 |
| id_response_editor_0 | Correct |
|
|
|
232 |
| id_jumpto_0 | End of lesson |
|
|
|
233 |
| id_score_0 | 2 |
|
|
|
234 |
| id_answer_editor_1 | False |
|
|
|
235 |
| id_response_editor_1 | Wrong |
|
|
|
236 |
| id_jumpto_1 | This page |
|
|
|
237 |
| id_score_1 | 0 |
|
|
|
238 |
And I press "Save page"
|
|
|
239 |
And I select edit type "Expanded"
|
|
|
240 |
Then I should see "True/false question"
|
|
|
241 |
And I should see "Paper is made from trees."
|
|
|
242 |
And I should see "True" in the "Answer 1" "table_row"
|
|
|
243 |
And I should see "Correct" in the "Response 1" "table_row"
|
|
|
244 |
And I should see "End of lesson" in the "//tr[contains(.,'Jump')][1]" "xpath_element"
|
|
|
245 |
And I should see "2" in the "//tr[contains(.,'Score')][1]" "xpath_element"
|
|
|
246 |
And I should see "False" in the "Answer 2" "table_row"
|
|
|
247 |
And I should see "Wrong" in the "Response 2" "table_row"
|
|
|
248 |
And I should see "This page" in the "//tr[contains(.,'Jump')][2]" "xpath_element"
|
|
|
249 |
And I should see "0" in the "//tr[contains(.,'Score')][2]" "xpath_element"
|
|
|
250 |
|
|
|
251 |
Scenario: Create cluster pages
|
|
|
252 |
When I am on the "Test lesson name" "lesson activity" page logged in as teacher1
|
|
|
253 |
And I follow "Add a cluster"
|
|
|
254 |
And I select edit type "Expanded"
|
|
|
255 |
And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][2]" "xpath_element"
|
|
|
256 |
And I set the field "Select a question type" to "Multichoice"
|
|
|
257 |
And I press "Add a question page"
|
|
|
258 |
And I set the following fields to these values:
|
|
|
259 |
| Page title | question 1 |
|
|
|
260 |
| Page contents | Question from cluster |
|
|
|
261 |
| id_answer_editor_0 | Correct answer |
|
|
|
262 |
| id_response_editor_0 | Good |
|
|
|
263 |
| id_jumpto_0 | Cluster |
|
|
|
264 |
| id_score_0 | 1 |
|
|
|
265 |
| id_answer_editor_1 | Incorrect answer |
|
|
|
266 |
| id_response_editor_1 | Bad |
|
|
|
267 |
| id_jumpto_1 | This page |
|
|
|
268 |
| id_score_1 | 0 |
|
|
|
269 |
And I press "Save page"
|
|
|
270 |
And I click on "Add a content page" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][3]" "xpath_element"
|
|
|
271 |
And I set the following fields to these values:
|
|
|
272 |
| Page title | Second page name |
|
|
|
273 |
| Page contents | This page mark the the beginning of the subcluster it should not be seen by students |
|
|
|
274 |
| id_answer_editor_0 | Next page |
|
|
|
275 |
| id_jumpto_0 | Next page |
|
|
|
276 |
And I press "Save page"
|
|
|
277 |
And I click on "Add an end of branch" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][4]" "xpath_element"
|
|
|
278 |
And I click on "Add an end of cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][5]" "xpath_element"
|
|
|
279 |
Then I should see "Cluster"
|
|
|
280 |
And I should see "Unseen question within a cluster" in the "//tr[contains(.,'Jump')][1]" "xpath_element"
|
|
|
281 |
And I should see "Question from cluster"
|
|
|
282 |
And I should see "This page mark the the beginning of the subcluster it should not be seen by students"
|
|
|
283 |
And I should see "End of branch"
|
|
|
284 |
And I should see "End of cluster"
|