MDL-52989 mod_lesson: Fix typo in feature description
[moodle.git] / mod / lesson / tests / behat / lesson_exit_enter_clusters.feature
CommitLineData
2ffd2afd 1@mod @mod_lesson
9ce10f2f 2Feature: In a lesson activity, students can exit and re-enter the activity when it consists only of cluster pages
2ffd2afd
LB
3 As a student
4 I need to exit and re-enter a lesson out and into clusters.
5
6 Background:
7 Given the following "users" exist:
8 | username | firstname | lastname | email |
9 | teacher1 | Teacher | 1 | teacher1@example.com |
10 | student1 | Student | 1 | student1@example.com |
11 And the following "courses" exist:
12 | fullname | shortname | category |
13 | Course 1 | C1 | 0 |
14 And the following "course enrolments" exist:
15 | user | course | role |
16 | teacher1 | C1 | editingteacher |
17 | student1 | C1 | student |
18 And I log in as "teacher1"
19 And I am on "Course 1" course homepage with editing mode on
20 And I add a "Lesson" to section "1" and I fill the form with:
21 | Name | Lesson with cluster |
22 | Description | Cluster lesson description |
23 And I follow "Lesson with cluster"
24 And I follow "Add a content page"
25 And I set the following fields to these values:
26 | Page title | First page name |
27 | Page contents | First page contents |
28 | id_answer_editor_0 | Next page |
29 | id_jumpto_0 | Next page |
30 And I press "Save page"
31 And I follow "Expanded"
32 And I click on "Add a cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][2]" "xpath_element"
33 And I follow "Update page: Cluster"
34 And I set the following fields to these values:
35 | Page title | C Cluster |
36 | Page contents | C Cluster |
37 | Jump | Unseen question within a cluster |
38 And I press "Save page"
39 And I click on "Add a cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][2]" "xpath_element"
40 And I follow "Update page: Cluster"
41 And I set the following fields to these values:
42 | Page title | B Cluster |
43 | Page contents | B Cluster |
44 | Jump | Unseen question within a cluster |
45 And I press "Save page"
46 And I click on "Add a cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][2]" "xpath_element"
47 And I follow "Update page: Cluster"
48 And I set the following fields to these values:
49 | Page title | A Cluster |
50 | Page contents | A Cluster |
51 | Jump | Unseen question within a cluster |
52 And I press "Save page"
53 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][3]" "xpath_element"
54 And I set the field "Select a question type" to "Multichoice"
55 And I press "Add a question page"
56 And I set the following fields to these values:
57 | Page title | Question 1 A Cluster |
58 | Page contents | Question 1 from A cluster |
59 | id_answer_editor_0 | Correct answer |
60 | id_response_editor_0 | Good |
61 | id_jumpto_0 | B Cluster |
62 | id_score_0 | 1 |
63 | id_answer_editor_1 | Incorrect answer |
64 | id_response_editor_1 | Bad |
65 | id_jumpto_1 | Unseen question within a cluster |
66 | id_score_1 | 0 |
67 And I press "Save page"
68 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][4]" "xpath_element"
69 And I set the field "Select a question type" to "Multichoice"
70 And I press "Add a question page"
71 And I set the following fields to these values:
72 | Page title | Question 2 A Cluster |
73 | Page contents | Question 2 from A cluster |
74 | id_answer_editor_0 | Correct answer |
75 | id_response_editor_0 | Good |
76 | id_jumpto_0 | B Cluster |
77 | id_score_0 | 1 |
78 | id_answer_editor_1 | Incorrect answer |
79 | id_response_editor_1 | Bad |
80 | id_jumpto_1 | Unseen question within a cluster |
81 | id_score_1 | 0 |
82 And I press "Save page"
83 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][5]" "xpath_element"
84 And I press "Add a question page"
85 And I set the following fields to these values:
86 | Page title | Question 3 A Cluster |
87 | Page contents | Question 3 from A cluster |
88 | id_answer_editor_0 | Correct answer |
89 | id_response_editor_0 | Good |
90 | id_jumpto_0 | B Cluster |
91 | id_score_0 | 1 |
92 | id_answer_editor_1 | Incorrect answer |
93 | id_response_editor_1 | Bad |
94 | id_jumpto_1 | Unseen question within a cluster |
95 | id_score_1 | 0 |
96 And I press "Save page"
97 And I click on "Add an end of cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][6]" "xpath_element"
98 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][8]" "xpath_element"
99 And I set the field "Select a question type" to "Multichoice"
100 And I press "Add a question page"
101 And I set the following fields to these values:
102 | Page title | Question 1 B Cluster |
103 | Page contents | Question 1 from B cluster |
104 | id_answer_editor_0 | Correct answer |
105 | id_response_editor_0 | Good |
106 | id_jumpto_0 | C Cluster |
107 | id_score_0 | 1 |
108 | id_answer_editor_1 | Incorrect answer |
109 | id_response_editor_1 | Bad |
110 | id_jumpto_1 | Unseen question within a cluster |
111 | id_score_1 | 0 |
112 And I press "Save page"
113 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][9]" "xpath_element"
114 And I set the field "Select a question type" to "Multichoice"
115 And I press "Add a question page"
116 And I set the following fields to these values:
117 | Page title | Question 2 B Cluster |
118 | Page contents | Question 2 from B cluster |
119 | id_answer_editor_0 | Correct answer |
120 | id_response_editor_0 | Good |
121 | id_jumpto_0 | C Cluster |
122 | id_score_0 | 1 |
123 | id_answer_editor_1 | Incorrect answer |
124 | id_response_editor_1 | Bad |
125 | id_jumpto_1 | Unseen question within a cluster |
126 | id_score_1 | 0 |
127 And I press "Save page"
128 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][10]" "xpath_element"
129 And I press "Add a question page"
130 And I set the following fields to these values:
131 | Page title | Question 3 B Cluster |
132 | Page contents | Question 3 from B cluster |
133 | id_answer_editor_0 | Correct answer |
134 | id_response_editor_0 | Good |
135 | id_jumpto_0 | C Cluster |
136 | id_score_0 | 1 |
137 | id_answer_editor_1 | Incorrect answer |
138 | id_response_editor_1 | Bad |
139 | id_jumpto_1 | Unseen question within a cluster |
140 | id_score_1 | 0 |
141 And I press "Save page"
142 And I click on "Add an end of cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][11]" "xpath_element"
143 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][13]" "xpath_element"
144 And I set the field "Select a question type" to "Multichoice"
145 And I press "Add a question page"
146 And I set the following fields to these values:
147 | Page title | Question 1 C Cluster |
148 | Page contents | Question 1 from C cluster |
149 | id_answer_editor_0 | Correct answer |
150 | id_response_editor_0 | Good |
151 | id_jumpto_0 | End of lesson |
152 | id_score_0 | 1 |
153 | id_answer_editor_1 | Incorrect answer |
154 | id_response_editor_1 | Bad |
155 | id_jumpto_1 | Unseen question within a cluster |
156 | id_score_1 | 0 |
157 And I press "Save page"
158 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][14]" "xpath_element"
159 And I set the field "Select a question type" to "Multichoice"
160 And I press "Add a question page"
161 And I set the following fields to these values:
162 | Page title | Question 2 C Cluster |
163 | Page contents | Question 2 from C cluster |
164 | id_answer_editor_0 | Correct answer |
165 | id_response_editor_0 | Good |
166 | id_jumpto_0 | End of lesson |
167 | id_score_0 | 1 |
168 | id_answer_editor_1 | Incorrect answer |
169 | id_response_editor_1 | Bad |
170 | id_jumpto_1 | Unseen question within a cluster |
171 | id_score_1 | 0 |
172 And I press "Save page"
173 And I click on "Add a question page here" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][15]" "xpath_element"
174 And I press "Add a question page"
175 And I set the following fields to these values:
176 | Page title | Question 3 C Cluster |
177 | Page contents | Question 3 from C cluster |
178 | id_answer_editor_0 | Correct answer |
179 | id_response_editor_0 | Good |
180 | id_jumpto_0 | End of lesson |
181 | id_score_0 | 1 |
182 | id_answer_editor_1 | Incorrect answer |
183 | id_response_editor_1 | Bad |
184 | id_jumpto_1 | Unseen question within a cluster |
185 | id_score_1 | 0 |
186 And I press "Save page"
187 And I click on "Add an end of cluster" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' addlinks ')][16]" "xpath_element"
188 And I log out
189
190 Scenario: Accessing as student to a cluster only lesson
191 Given I log in as "student1"
192 And I am on "Course 1" course homepage
193 And I follow "Lesson with cluster"
194 And I should see "First page contents"
195 And I press "Next page"
196 And I should see "Correct answer"
197 And I set the following fields to these values:
198 | Incorrect answer | 1 |
199 And I press "Submit"
200 And I should see "Bad"
201 And I press "Continue"
202 And I set the following fields to these values:
203 | Incorrect answer | 1 |
204 And I press "Submit"
205 And I should see "Bad"
206 And I press "Continue"
207 And I set the following fields to these values:
208 | Correct answer | 1 |
209 And I press "Submit"
210 And I should see "Good"
211 And I press "Continue"
212 And I should see "Incorrect answer"
213 And I set the following fields to these values:
214 | Incorrect answer | 1 |
215 And I press "Submit"
216 And I am on "Course 1" course homepage
217 And I follow "Lesson with cluster"
218 And I should see "Do you want to start at the last page you saw?"
219 And I click on "No" "link" in the "#page-content" "css_element"
220 And I should see "First page contents"
221 And I press "Next page"
222 And I should see "Correct answer"
223 And I set the following fields to these values:
224 | Correct answer | 1 |
225 And I press "Submit"
226 And I should see "Good"
227 And I press "Continue"
9ce10f2f 228 Then I should see "Correct answer"