1 |
efrain |
1 |
@mod @mod_lesson
|
|
|
2 |
Feature: In a lesson activity, students can navigate through a series of pages in various ways depending upon their answers to questions
|
|
|
3 |
In order to create a lesson with conditional paths
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to add pages and questions with links between them
|
|
|
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 |
| page | <span class="multilang" lang="en">A page (EN)</span><span class="multilang" lang="eu">Orri bat (EU)</span> | C1 | PAGE1 |
|
|
|
23 |
|
|
|
24 |
Scenario: Student navigation with pages and questions
|
|
|
25 |
Given the "multilang" filter is "on"
|
|
|
26 |
And the "multilang" filter applies to "content and headings"
|
|
|
27 |
Given the following "mod_lesson > pages" exist:
|
|
|
28 |
| lesson | qtype | title | content |
|
|
|
29 |
| Test lesson name | content | First page name | First page contents |
|
|
|
30 |
| Test lesson name | content | Second page name | Second page contents |
|
|
|
31 |
| Test lesson name | numeric | Hardest question ever | 1 + 1? |
|
|
|
32 |
And the following "mod_lesson > answers" exist:
|
|
|
33 |
| page | answer | response | jumpto | score |
|
|
|
34 |
| First page name | Next page | | Next page | 0 |
|
|
|
35 |
| Second page name | Previous page | | Previous page | 0 |
|
|
|
36 |
| Second page name | Next page | | Next page | 0 |
|
|
|
37 |
| Hardest question ever | 2 | Correct answer | End of lesson | 1 |
|
|
|
38 |
| Hardest question ever | 1 | Incorrect answer | Second page name | 0 |
|
|
|
39 |
When I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
|
|
|
40 |
And I expand all fieldsets
|
|
|
41 |
And I set the field "Link to next activity" to "Page - A page (EN)"
|
|
|
42 |
And I press "Save and display"
|
|
|
43 |
And I am on the "Test lesson name" "lesson activity" page logged in as student1
|
|
|
44 |
Then I should see "First page contents"
|
|
|
45 |
And I press "Next page"
|
|
|
46 |
And I should see "Second page contents"
|
|
|
47 |
And I should not see "First page contents"
|
|
|
48 |
And I press "Previous page"
|
|
|
49 |
And I should see "First page contents"
|
|
|
50 |
And I should not see "Second page contents"
|
|
|
51 |
And I press "Next page"
|
|
|
52 |
And I should see "Second page contents"
|
|
|
53 |
And I press "Next page"
|
|
|
54 |
And I should see "1 + 1?"
|
|
|
55 |
And I set the following fields to these values:
|
|
|
56 |
| Your answer | 1 |
|
|
|
57 |
And I press "Submit"
|
|
|
58 |
And I should see "Incorrect answer"
|
|
|
59 |
And I press "Continue"
|
|
|
60 |
And I should see "Second page name"
|
|
|
61 |
And I press "Next page"
|
|
|
62 |
And I should see "1 + 1?"
|
|
|
63 |
And I set the following fields to these values:
|
|
|
64 |
| Your answer | 2 |
|
|
|
65 |
And I press "Submit"
|
|
|
66 |
And I should see "Maximum number of attempts reached - Moving to next page"
|
|
|
67 |
And I press "Continue"
|
|
|
68 |
And I should see "Congratulations - end of lesson reached"
|
|
|
69 |
And I should see "Your score is 0 (out of 1)."
|
|
|
70 |
And I should see "Go to A page (EN)"
|
|
|
71 |
And I should not see "Orri bat (EU)"
|
|
|
72 |
|
|
|
73 |
Scenario: Student reattempts a question until out of attempts
|
|
|
74 |
Given the following "mod_lesson > page" exist:
|
|
|
75 |
| lesson | qtype | title | content |
|
|
|
76 |
| Test lesson name | truefalse | Test question | Test content |
|
|
|
77 |
And the following "mod_lesson > answers" exist:
|
|
|
78 |
| page | answer | jumpto | score |
|
|
|
79 |
| Test question | right | Next page | 1 |
|
|
|
80 |
| Test question | wrong | This page | 0 |
|
|
|
81 |
And I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
|
|
|
82 |
And I set the following fields to these values:
|
|
|
83 |
| id_review | Yes |
|
|
|
84 |
| id_maxattempts | 3 |
|
|
|
85 |
And I press "Save and display"
|
|
|
86 |
When I am on the "Test lesson name" "lesson activity" page logged in as student1
|
|
|
87 |
Then I should see "Test content"
|
|
|
88 |
And I set the following fields to these values:
|
|
|
89 |
| wrong | 1 |
|
|
|
90 |
And I press "Submit"
|
|
|
91 |
And I should see "You have 2 attempt(s) remaining"
|
|
|
92 |
And I press "Yes, I'd like to try again"
|
|
|
93 |
And I should see "Test content"
|
|
|
94 |
And I set the following fields to these values:
|
|
|
95 |
| wrong | 1 |
|
|
|
96 |
And I press "Submit"
|
|
|
97 |
And I should see "You have 1 attempt(s) remaining"
|
|
|
98 |
And I press "Yes, I'd like to try again"
|
|
|
99 |
And I should see "Test content"
|
|
|
100 |
And I set the following fields to these values:
|
|
|
101 |
| wrong | 1 |
|
|
|
102 |
And I press "Submit"
|
|
|
103 |
And I should not see "Yes, I'd like to try again"
|
|
|
104 |
And I press "Continue"
|
|
|
105 |
And I should see "Congratulations - end of lesson reached"
|
|
|
106 |
|
|
|
107 |
Scenario: Student reattempts a question until out of attempts with specific jumps
|
|
|
108 |
Given the following "mod_lesson > pages" exist:
|
|
|
109 |
| lesson | qtype | title | content |
|
|
|
110 |
| Test lesson name | truefalse | Test question | Test content 1 |
|
|
|
111 |
| Test lesson name | truefalse | Test question 2 | Test content 2 |
|
|
|
112 |
And the following "mod_lesson > answers" exist:
|
|
|
113 |
| page | answer | jumpto | score |
|
|
|
114 |
| Test question | right | Next page | 1 |
|
|
|
115 |
| Test question | wrong | This page | 0 |
|
|
|
116 |
| Test question 2 | right | Test question | 1 |
|
|
|
117 |
| Test question 2 | wrong | Test question | 0 |
|
|
|
118 |
And I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
|
|
|
119 |
And I set the following fields to these values:
|
|
|
120 |
| id_review | Yes |
|
|
|
121 |
| id_maxattempts | 3 |
|
|
|
122 |
And I press "Save and display"
|
|
|
123 |
When I am on the "Test lesson name" "lesson activity" page logged in as student1
|
|
|
124 |
Then I should see "Test content 1"
|
|
|
125 |
And I set the following fields to these values:
|
|
|
126 |
| right | 1 |
|
|
|
127 |
And I press "Submit"
|
|
|
128 |
And I should see "Test content 2"
|
|
|
129 |
And I set the following fields to these values:
|
|
|
130 |
| wrong | 1 |
|
|
|
131 |
And I press "Submit"
|
|
|
132 |
And I should see "You have 2 attempt(s) remaining"
|
|
|
133 |
And I press "Yes, I'd like to try again"
|
|
|
134 |
And I should see "Test content 2"
|
|
|
135 |
And I set the following fields to these values:
|
|
|
136 |
| wrong | 1 |
|
|
|
137 |
And I press "Submit"
|
|
|
138 |
And I should see "You have 1 attempt(s) remaining"
|
|
|
139 |
And I press "Yes, I'd like to try again"
|
|
|
140 |
And I should see "Test content 2"
|
|
|
141 |
And I set the following fields to these values:
|
|
|
142 |
| wrong | 1 |
|
|
|
143 |
And I press "Submit"
|
|
|
144 |
And I should not see "Yes, I'd like to try again"
|
|
|
145 |
And I press "Continue"
|
|
|
146 |
And I should see "Test content 1"
|
|
|
147 |
|
|
|
148 |
Scenario: Student should not see remaining attempts notification if maximum number of attempts is set to unlimited
|
|
|
149 |
Given the following "mod_lesson > page" exist:
|
|
|
150 |
| lesson | qtype | title | content |
|
|
|
151 |
| Test lesson name | truefalse | Test question | Test content |
|
|
|
152 |
And the following "mod_lesson > answers" exist:
|
|
|
153 |
| page | answer | jumpto | score |
|
|
|
154 |
| Test question | right | Next page | 1 |
|
|
|
155 |
| Test question | wrong | This page | 0 |
|
|
|
156 |
And I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
|
|
|
157 |
And I set the following fields to these values:
|
|
|
158 |
| id_review | Yes |
|
|
|
159 |
| id_maxattempts | 0 |
|
|
|
160 |
And I press "Save and display"
|
|
|
161 |
When I am on the "Test lesson name" "lesson activity" page logged in as student1
|
|
|
162 |
Then I should see "Test content"
|
|
|
163 |
And I set the following fields to these values:
|
|
|
164 |
| wrong | 1 |
|
|
|
165 |
And I press "Submit"
|
|
|
166 |
And I should not see "attempt(s) remaining"
|
|
|
167 |
And I press "Yes, I'd like to try again"
|
|
|
168 |
And I should see "Test content"
|
|
|
169 |
And I set the following fields to these values:
|
|
|
170 |
| right | 1 |
|
|
|
171 |
And I press "Submit"
|
|
|
172 |
And I should not see "Yes, I'd like to try again"
|
|
|
173 |
And I should see "Congratulations - end of lesson reached"
|