2 Feature: In Dashboard, a student can see their current status on all lessons with an upcoming due date
3 In order to know my status on a lesson
5 I need to see it in Dashboard
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | teacher1 | Teacher | 1 | teacher1@asd.com |
11 | student1 | Student | 1 | student1@asd.com |
12 And the following "courses" exist:
13 | fullname | shortname | category |
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 | intro | deadline | retake | course | idnumber |
21 | lesson | Test lesson name | Test lesson description | 1893481200 | 1 | C1 | lesson1 |
22 And I log in as "teacher1"
23 And I follow "Course 1"
24 And I turn editing mode on
27 Scenario: A completed lesson with only questions that allows multiple attempts
28 Given I follow "Test lesson name"
29 And I follow "Add a question page"
30 And I set the field "Select a question type" to "True/false"
31 And I press "Add a question page"
32 And I set the following fields to these values:
33 | Page title | True/false question 1 |
34 | Page contents | Cat is an amphibian |
35 | id_answer_editor_0 | False |
36 | id_response_editor_0 | Correct |
37 | id_jumpto_0 | Next page |
38 | id_answer_editor_1 | True |
39 | id_response_editor_1 | Wrong |
40 | id_jumpto_1 | This page |
41 And I press "Save page"
42 And I set the field "qtype" to "Question"
43 And I set the field "Select a question type" to "True/false"
44 And I press "Add a question page"
45 And I set the following fields to these values:
46 | Page title | True/false question 2 |
47 | Page contents | Paper is made from trees. |
48 | id_answer_editor_0 | True |
49 | id_response_editor_0 | Correct |
50 | id_jumpto_0 | Next page |
51 | id_answer_editor_1 | False |
52 | id_response_editor_1 | Wrong |
53 | id_jumpto_1 | This page |
54 And I press "Save page"
56 And I log in as "student1"
57 And I follow "Course 1"
58 And I follow "Test lesson name"
59 And I should see "Cat is an amphibian"
60 And I set the following fields to these values:
63 And I press "Continue"
64 And I should see "Paper is made from trees."
65 And I set the following fields to these values:
68 And I press "Continue"
69 And I should see "Congratulations - end of lesson reached"
70 When I click on "Dashboard" "link" in the "Navigation" "block"
71 Then I should see "You have lessons that are due"
72 And I click on ".collapsibleregioncaption" "css_element"
73 And I should see "Completed, You can re-attempt this lesson"
76 Scenario: A completed lesson with only questions that does not allow multiple attempts
77 Given I follow "Test lesson name"
78 And I navigate to "Edit settings" node in "Lesson administration"
79 And I set the following fields to these values:
80 | Re-takes allowed | 0 |
81 And I press "Save and display"
82 And I follow "Add a question page"
83 And I set the field "Select a question type" to "True/false"
84 And I press "Add a question page"
85 And I set the following fields to these values:
86 | Page title | True/false question 1 |
87 | Page contents | Cat is an amphibian |
88 | id_answer_editor_0 | False |
89 | id_response_editor_0 | Correct |
90 | id_jumpto_0 | Next page |
91 | id_answer_editor_1 | True |
92 | id_response_editor_1 | Wrong |
93 | id_jumpto_1 | This page |
94 And I press "Save page"
95 And I set the field "qtype" to "Question"
96 And I set the field "Select a question type" to "True/false"
97 And I press "Add a question page"
98 And I set the following fields to these values:
99 | Page title | True/false question 2 |
100 | Page contents | Paper is made from trees. |
101 | id_answer_editor_0 | True |
102 | id_response_editor_0 | Correct |
103 | id_jumpto_0 | Next page |
104 | id_answer_editor_1 | False |
105 | id_response_editor_1 | Wrong |
106 | id_jumpto_1 | This page |
107 And I press "Save page"
109 And I log in as "student1"
110 And I follow "Course 1"
111 And I follow "Test lesson name"
112 And I should see "Cat is an amphibian"
113 And I set the following fields to these values:
116 And I press "Continue"
117 And I should see "Paper is made from trees."
118 And I set the following fields to these values:
121 And I press "Continue"
122 And I should see "Congratulations - end of lesson reached"
123 When I click on "Dashboard" "link" in the "Navigation" "block"
124 Then I should not see "You have lessons that are due"
127 Scenario: A completed lesson with only content pages that allows multiple attempts
128 Given I follow "Test lesson name"
129 And I follow "Add a content page"
130 And I set the following fields to these values:
131 | Page title | First page name |
132 | Page contents | First page contents |
133 | id_answer_editor_0 | Next page |
134 | id_jumpto_0 | Next page |
135 And I press "Save page"
136 And I set the field "qtype" to "Add a content page"
137 And I set the following fields to these values:
138 | Page title | Second page name |
139 | Page contents | Second page contents |
140 | id_answer_editor_0 | Previous page |
141 | id_jumpto_0 | Previous page |
142 | id_answer_editor_1 | End of lesson |
143 | id_jumpto_1 | End of lesson |
144 And I press "Save page"
146 And I log in as "student1"
147 And I follow "Course 1"
148 And I follow "Test lesson name"
149 And I should see "First page contents"
150 And I press "Next page"
151 And I should see "Second page contents"
152 And I press "End of lesson"
153 When I click on "Dashboard" "link" in the "Navigation" "block"
154 Then I should see "You have lessons that are due"
155 And I click on ".collapsibleregioncaption" "css_element"
156 And I should see "Completed, You can re-attempt this lesson"
159 Scenario: A completed lesson with only content pages that does not allow multiple attempts
160 Given I follow "Test lesson name"
161 And I navigate to "Edit settings" node in "Lesson administration"
162 And I set the following fields to these values:
163 | Re-takes allowed | 0 |
164 And I press "Save and display"
165 And I follow "Add a content page"
166 And I set the following fields to these values:
167 | Page title | First page name |
168 | Page contents | First page contents |
169 | id_answer_editor_0 | Next page |
170 | id_jumpto_0 | Next page |
171 And I press "Save page"
172 And I set the field "qtype" to "Add a content page"
173 And I set the following fields to these values:
174 | Page title | Second page name |
175 | Page contents | Second page contents |
176 | id_answer_editor_0 | Previous page |
177 | id_jumpto_0 | Previous page |
178 | id_answer_editor_1 | End of lesson |
179 | id_jumpto_1 | End of lesson |
180 And I press "Save page"
182 And I log in as "student1"
183 And I follow "Course 1"
184 And I follow "Test lesson name"
185 And I should see "First page contents"
186 And I press "Next page"
187 And I should see "Second page contents"
188 And I press "End of lesson"
189 When I click on "Dashboard" "link" in the "Navigation" "block"
190 Then I should not see "You have lessons that are due"
193 Scenario: An incomplete lesson with only questions.
194 Given I follow "Test lesson name"
195 And I follow "Add a question page"
196 And I set the field "Select a question type" to "True/false"
197 And I press "Add a question page"
198 And I set the following fields to these values:
199 | Page title | True/false question 1 |
200 | Page contents | Cat is an amphibian |
201 | id_answer_editor_0 | False |
202 | id_response_editor_0 | Correct |
203 | id_jumpto_0 | Next page |
204 | id_answer_editor_1 | True |
205 | id_response_editor_1 | Wrong |
206 | id_jumpto_1 | This page |
207 And I press "Save page"
208 And I set the field "qtype" to "Question"
209 And I set the field "Select a question type" to "True/false"
210 And I press "Add a question page"
211 And I set the following fields to these values:
212 | Page title | True/false question 2 |
213 | Page contents | Paper is made from trees. |
214 | id_answer_editor_0 | True |
215 | id_response_editor_0 | Correct |
216 | id_jumpto_0 | Next page |
217 | id_answer_editor_1 | False |
218 | id_response_editor_1 | Wrong |
219 | id_jumpto_1 | This page |
220 And I press "Save page"
222 And I log in as "student1"
223 And I follow "Course 1"
224 And I follow "Test lesson name"
225 And I should see "Cat is an amphibian"
226 And I set the following fields to these values:
229 And I press "Continue"
230 When I click on "Dashboard" "link" in the "Navigation" "block"
231 Then I should see "You have lessons that are due"
232 And I click on ".collapsibleregioncaption" "css_element"
233 And I should see "Lesson has been started, but not yet completed"
236 Scenario: An incomplete lesson with only content pages.
237 Given I follow "Test lesson name"
238 And I follow "Add a content page"
239 And I set the following fields to these values:
240 | Page title | First page name |
241 | Page contents | First page contents |
242 | id_answer_editor_0 | Next page |
243 | id_jumpto_0 | Next page |
244 And I press "Save page"
245 And I set the field "qtype" to "Add a content page"
246 And I set the following fields to these values:
247 | Page title | Second page name |
248 | Page contents | Second page contents |
249 | id_answer_editor_0 | Previous page |
250 | id_jumpto_0 | Previous page |
251 | id_answer_editor_1 | End of lesson |
252 | id_jumpto_1 | End of lesson |
253 And I press "Save page"
255 And I log in as "student1"
256 And I follow "Course 1"
257 And I follow "Test lesson name"
258 And I should see "First page contents"
259 And I press "Next page"
260 And I should see "Second page contents"
261 When I click on "Dashboard" "link" in the "Navigation" "block"
262 Then I should see "You have lessons that are due"
263 And I click on ".collapsibleregioncaption" "css_element"
264 And I should see "Lesson has been started, but not yet completed"
267 Scenario: A lesson with only questions that has not been started.
268 Given I follow "Test lesson name"
269 And I follow "Add a question page"
270 And I set the field "Select a question type" to "True/false"
271 And I press "Add a question page"
272 And I set the following fields to these values:
273 | Page title | True/false question 1 |
274 | Page contents | Cat is an amphibian |
275 | id_answer_editor_0 | False |
276 | id_response_editor_0 | Correct |
277 | id_jumpto_0 | Next page |
278 | id_answer_editor_1 | True |
279 | id_response_editor_1 | Wrong |
280 | id_jumpto_1 | This page |
281 And I press "Save page"
282 And I set the field "qtype" to "Question"
283 And I set the field "Select a question type" to "True/false"
284 And I press "Add a question page"
285 And I set the following fields to these values:
286 | Page title | True/false question 2 |
287 | Page contents | Paper is made from trees. |
288 | id_answer_editor_0 | True |
289 | id_response_editor_0 | Correct |
290 | id_jumpto_0 | Next page |
291 | id_answer_editor_1 | False |
292 | id_response_editor_1 | Wrong |
293 | id_jumpto_1 | This page |
294 And I press "Save page"
296 And I log in as "student1"
297 When I click on "Dashboard" "link" in the "Navigation" "block"
298 Then I should see "You have lessons that are due"
299 And I click on ".collapsibleregioncaption" "css_element"
300 And I should see "No attempts have been made on this lesson"
303 Scenario: A lesson with only content pages that has not been started.
304 Given I follow "Test lesson name"
305 And I follow "Add a content page"
306 And I set the following fields to these values:
307 | Page title | First page name |
308 | Page contents | First page contents |
309 | id_answer_editor_0 | Next page |
310 | id_jumpto_0 | Next page |
311 And I press "Save page"
312 And I set the field "qtype" to "Add a content page"
313 And I set the following fields to these values:
314 | Page title | Second page name |
315 | Page contents | Second page contents |
316 | id_answer_editor_0 | Previous page |
317 | id_jumpto_0 | Previous page |
318 | id_answer_editor_1 | End of lesson |
319 | id_jumpto_1 | End of lesson |
320 And I press "Save page"
322 And I log in as "student1"
323 When I click on "Dashboard" "link" in the "Navigation" "block"
324 Then I should see "You have lessons that are due"
325 And I click on ".collapsibleregioncaption" "css_element"
326 And I should see "No attempts have been made on this lesson"