Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_quiz
2
Feature: Attempt a quiz
3
  As a student
4
  In order to demonstrate what I know
5
  I need to be able to attempt quizzes
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email               |
10
      | student  | Student   | One      | student@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
      | student  | C1     | student |
1441 ariadna 17
    And the following "activities" exist:
18
      | activity | name    | intro              | course | idnumber | grade | navmethod  |
19
      | quiz     | Quiz 1  | Quiz 1 description | C1     | quiz1    | 100   | free       |
20
      | quiz     | Quiz 2  | Quiz 2 description | C1     | quiz2    | 6     | free       |
21
      | quiz     | Quiz 3  | Quiz 3 description | C1     | quiz3    | 100   | free       |
22
      | quiz     | Quiz 4  | Quiz 4 description | C1     | quiz4    | 100   | sequential |
23
      | qbank    | Qbank 1 | Question bank 1    | C1     | qbank1   |       |            |
1 efrain 24
    And the following "question categories" exist:
1441 ariadna 25
      | contextlevel    | reference  | name            |
26
      | Activity module | quiz1     | Test questions  |
1 efrain 27
    And the following "questions" exist:
28
      | questioncategory | qtype       | name  | questiontext    |
29
      | Test questions   | truefalse   | TF1   | First question  |
30
      | Test questions   | truefalse   | TF2   | Second question |
31
      | Test questions   | truefalse   | TF3   | Third question  |
32
      | Test questions   | truefalse   | TF4   | Fourth question |
33
      | Test questions   | truefalse   | TF5   | Fifth question  |
34
      | Test questions   | truefalse   | TF6   | Sixth question  |
35
    And quiz "Quiz 1" contains the following questions:
36
      | question | page | maxmark |
37
      | TF1      | 1    |         |
38
      | TF2      | 1    | 3.0     |
39
    And quiz "Quiz 2" contains the following questions:
40
      | question | page |
41
      | TF1      | 1    |
42
      | TF2      | 1    |
43
      | TF3      | 2    |
44
      | TF4      | 3    |
45
      | TF5      | 4    |
46
      | TF6      | 4    |
47
    And quiz "Quiz 2" contains the following sections:
48
      | heading   | firstslot | shuffle |
49
      | Section 1 | 1         | 0       |
50
      | Section 2 | 3         | 0       |
51
      |           | 4         | 1       |
52
      | Section 3 | 5         | 1       |
53
    And quiz "Quiz 3" contains the following questions:
54
      | question | page |
55
      | TF1      | 1    |
56
      | TF2      | 2    |
57
    And quiz "Quiz 4" contains the following questions:
58
      | question | page |
59
      | TF1      | 1    |
60
      | TF2      | 2    |
61
 
62
  @javascript
63
  Scenario: Attempt a quiz with a single unnamed section, review and re-attempt
64
    Given user "student" has attempted "Quiz 1" with responses:
65
      | slot | response |
66
      |   1  | True     |
67
      |   2  | False    |
68
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
69
    And I follow "Review"
70
    And I should see "Status"
71
    Then I should see "Started"
72
    And I should see "Completed"
73
    And I should see "Duration"
74
    And I should see "Marks"
75
    And I should see "Grade"
76
    And I should see "25.00 out of 100.00"
77
    And I follow "Finish review"
1441 ariadna 78
    And I should see "Highest grade: 25.00 / 100.00"
1 efrain 79
    And I press "Re-attempt quiz"
80
 
81
  @javascript
82
  Scenario: Attempt a quiz with multiple sections
83
    Given I am on the "Quiz 2" "mod_quiz > View" page logged in as "student"
84
    When I press "Attempt quiz"
85
 
86
    Then I should see "Section 1" in the "Quiz navigation" "block"
87
    And I should see question "1" in section "Section 1" in the quiz navigation
88
    And I should see question "2" in section "Section 1" in the quiz navigation
89
    And I should see question "3" in section "Section 2" in the quiz navigation
90
    And I should see question "4" in section "Untitled section" in the quiz navigation
91
    And I should see question "5" in section "Section 3" in the quiz navigation
92
    And I should see question "6" in section "Section 3" in the quiz navigation
93
    And I click on "True" "radio" in the "First question" "question"
94
 
95
    And I follow "Finish attempt ..."
96
    And I should see question "1" in section "Section 1" in the quiz navigation
97
    And I should see question "2" in section "Section 1" in the quiz navigation
98
    And I should see question "3" in section "Section 2" in the quiz navigation
99
    And I should see question "4" in section "Untitled section" in the quiz navigation
100
    And I should see question "5" in section "Section 3" in the quiz navigation
101
    And I should see question "6" in section "Section 3" in the quiz navigation
102
    And I should see "Section 1" in the "quizsummaryofattempt" "table"
103
    And I should see "Section 2" in the "quizsummaryofattempt" "table"
104
    And I should see "Untitled section" in the "quizsummaryofattempt" "table"
105
    And I should see "Section 3" in the "quizsummaryofattempt" "table"
106
 
107
    And I press "Submit all and finish"
108
    And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
109
    And I should see "1.00 out of 6.00 (16.67%)" in the "Grade" "table_row"
110
    And I should see question "1" in section "Section 1" in the quiz navigation
111
    And I should see question "2" in section "Section 1" in the quiz navigation
112
    And I should see question "3" in section "Section 2" in the quiz navigation
113
    And I should see question "4" in section "Untitled section" in the quiz navigation
114
    And I should see question "5" in section "Section 3" in the quiz navigation
115
    And I should see question "6" in section "Section 3" in the quiz navigation
116
 
117
    And I follow "Show one page at a time"
118
    And I should see "First question"
119
    And I should not see "Third question"
120
    And I should see "Next page"
121
 
122
    And I follow "Show all questions on one page"
123
    And I should see "Fourth question"
124
    And I should see "Sixth question"
125
    And I should not see "Next page"
126
 
127
  @javascript
128
  Scenario: Next and previous navigation
129
    Given I am on the "Quiz 3" "mod_quiz > View" page logged in as "student"
130
    When I press "Attempt quiz"
131
    Then I should see "First question"
132
    And I should not see "Second question"
133
    And I press "Next page"
134
    And I should see "Second question"
135
    And I should not see "First question"
136
    And I click on "Finish attempt ..." "button" in the "region-main" "region"
137
    And I should see "Summary of attempt"
138
    And I press "Return to attempt"
139
    And I should see "Second question"
140
    And I should not see "First question"
141
    And I press "Previous page"
142
    And I should see "First question"
143
    And I should not see "Second question"
144
    And I follow "Finish attempt ..."
145
    And I press "Submit all and finish"
146
    And I should see "Once you submit your answers, you won’t be able to change them." in the "Submit all your answers and finish?" "dialogue"
147
    And I should see "Questions without a response: 2" in the "Submit all your answers and finish?" "dialogue"
148
    And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
149
    And I should see "0.00 out of 100.00" in the "Grade" "table_row"
150
    And I should see "First question"
151
    And I should see "Second question"
152
    And I follow "Show one page at a time"
153
    And I should see "0.00 out of 100.00" in the "Grade" "table_row"
154
    And I should see "First question"
155
    And I should not see "Second question"
156
    And I follow "Next page"
157
    And "Grade" "table_row" should not exist
158
    And I should see "Second question"
159
    And I should not see "First question"
160
    And I follow "Previous page"
161
    And I should see "0.00 out of 100.00" in the "Grade" "table_row"
162
    And I should see "First question"
163
    And I should not see "Second question"
164
 
165
  @javascript
166
  Scenario: Next and previous with sequential navigation method
167
    Given I am on the "Quiz 4" "mod_quiz > View" page logged in as "student"
168
    When I press "Attempt quiz"
169
    Then I should see "First question"
170
    And I should not see "Second question"
171
    And I press "Next page"
172
    And I should see "Second question"
173
    And I should not see "First question"
174
    And "Previous page" "button" should not exist
175
    And I click on "Finish attempt ..." "button" in the "region-main" "region"
176
    And I should see "Summary of attempt"
177
    And I press "Submit all and finish"
178
    And I should see "Once you submit your answers, you won’t be able to change them." in the "Submit all your answers and finish?" "dialogue"
179
    And I should not see "Questions without a response: 2" in the "Submit all your answers and finish?" "dialogue"
180
    And I click on "Submit" "button" in the "Submit all your answers and finish?" "dialogue"
181
    And I should see "First question"
182
    And I should see "Second question"
183
    And I follow "Show one page at a time"
184
    And I should see "First question"
185
    And I should not see "Second question"
186
    And I follow "Next page"
187
    And I should see "Second question"
188
    And I should not see "First question"
189
    And I follow "Previous page"
190
    And I should see "First question"
191
    And I should not see "Second question"
192
 
193
  @javascript
194
  Scenario: Take a quiz with number of attempts set
195
    Given the following "activities" exist:
196
      | activity | name   | course | grade | navmethod  | attempts |
197
      | quiz     | Quiz 5 | C1     | 100   | free       | 2        |
198
    And the following "questions" exist:
199
      | questioncategory | qtype       | name  | questiontext    |
200
      | Test questions   | truefalse   | TF7   | First question  |
201
    And quiz "Quiz 5" contains the following questions:
202
      | question | page |
203
      | TF7      | 1    |
204
    And user "student" has attempted "Quiz 5" with responses:
205
      | slot | response |
206
      |   1  | True     |
207
    When I am on the "Quiz 5" "mod_quiz > View" page logged in as "student"
208
    Then I should see "Attempts allowed: 2"
209
    And I should not see "No more attempts are allowed"
210
    And I press "Re-attempt quiz"
211
    And I should see "First question"
212
    And I click on "Finish attempt ..." "button" in the "region-main" "region"
213
    And I press "Submit all and finish"
214
    And I should see "Once you submit your answers, you won’t be able to change them." in the "Submit all your answers and finish?" "dialogue"
215
    And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
216
    And I follow "Finish review"
217
    And I should not see "Re-attempt quiz"
218
    And I should see "No more attempts are allowed"
219
 
220
  @javascript
221
  Scenario: Student still sees the same version after the question is edited.
222
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
223
    And I press "Attempt quiz"
224
    And I should see "First question"
225
    And I click on "False" "radio" in the "First question" "question"
226
    And I press "Finish attempt ..."
227
    And I log out
228
    And I am on the "Quiz 1" "mod_quiz > View" page logged in as "admin"
229
    And I press "Preview quiz"
230
    And I click on "Edit question" "link" in the "First question" "question"
231
    And I set the field "Question text" to "First question version 2"
232
    And I press "id_submitbutton"
233
    And I should see "v2 (latest)" in the "First question" "question"
234
    And I log out
235
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
236
    And I press "Continue your attempt"
237
    Then I should see "First question"
238
    And I should not see "First question version 2"