Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_quiz
2
Feature: Allow students to redo questions in a practice quiz, without starting a whole new attempt
3
  In order to practice particular skills I am struggling with
4
  As a student
5
  I need to be able to redo each question in a quiz as often as necessary without starting a whole new attempt, if my teacher allows it.
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname |
10
      | student  | Student   | One      |
11
      | teacher  | Teacher   | One      |
12
      | editor   | Question  | Editor   |
13
    And the following "courses" exist:
14
      | fullname | shortname | category |
15
      | Course 1 | C1        | 0        |
16
    And the following "course enrolments" exist:
17
      | user    | course | role           |
18
      | student | C1     | student        |
19
      | teacher | C1     | teacher        |
20
      | editor  | C1     | editingteacher |
21
    And the following "question categories" exist:
22
      | contextlevel | reference | name           |
23
      | Course       | C1        | Test questions |
24
    And the following "questions" exist:
25
      | questioncategory | qtype     | name | questiontext    |
26
      | Test questions   | truefalse | TF1  | First question  |
27
      | Test questions   | truefalse | TF2  | Second question |
28
    And the following "activities" exist:
29
      | activity | name   | intro              | course | idnumber | preferredbehaviour | canredoquestions |
30
      | quiz     | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  | 1                |
31
    And quiz "Quiz 1" contains the following questions:
32
      | question | page | maxmark |
33
      | TF1      | 1    | 2       |
34
      | TF2      | 1    | 1       |
35
 
36
  @javascript
37
  Scenario: After completing a question, there is a redo question button that restarts the question
38
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
39
    When I press "Attempt quiz"
40
    And I click on "False" "radio" in the "First question" "question"
41
    And I click on "Check" "button" in the "First question" "question"
42
    And I press "Try another question like this one"
43
    Then the state of "First question" question is shown as "Not complete"
44
    And I should see "Marked out of 2.00" in the "First question" "question"
45
 
46
  @javascript
47
  Scenario: After redoing a question, regrade works
48
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
49
    When I press "Attempt quiz"
50
    And I click on "False" "radio" in the "First question" "question"
51
    And I click on "Check" "button" in the "First question" "question"
52
    And I press "Try another question like this one"
53
    And I am on the "Quiz 1" "mod_quiz > Grades report" page logged in as "teacher"
54
    And I press "Regrade all"
55
    Then I should see "Finished regrading (1/1)"
56
    And I should see "Regrade completed"
57
    And I press "Continue"
58
    # Regrade a second time, to ensure the first regrade did not corrupt any data.
59
    And I press "Regrade all"
60
    And I should see "Finished regrading (1/1)"
61
    And I should see "Regrade completed"
62
 
63
  @javascript
64
  Scenario: Start attempt, teacher edits question, redo picks up latest non-draft version
65
    # Start attempt as student.
66
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
67
    And I press "Attempt quiz"
68
    And I click on "False" "radio" in the "First question" "question"
69
    And I click on "Check" "button" in the "First question" "question"
70
    And I log out
71
 
72
    # Now edit the question as teacher to add a real version and a draft version.
73
    # Would be nice to do this with a generator, but I don't have time right now.
74
    And I am on the "TF1" "core_question > edit" page logged in as "editor"
75
    And I set the following fields to these values:
76
      | Question name   | TF1-v2                 |
77
      | Question text   | The new first question |
78
      | Correct answer  | False                  |
79
    And I press "id_submitbutton"
80
    And I am on the "TF1-v2" "core_question > edit" page
81
    And I set the following fields to these values:
82
      | Question name   | TF1-v3                     |
83
      | Question text   | This is only draft for now |
84
      | Correct answer  | True                       |
85
      | Question status | Draft                      |
86
    And I press "id_submitbutton"
87
    And I log out
88
 
89
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
90
    And I press "Continue your attempt"
91
    And I press "Try another question like this one"
92
    Then the state of "The new first question" question is shown as "Not complete"
93
    And I should see "Marked out of 2.00" in the "The new first question" "question"
94
    And I should not see "This is only draft for now"
95
 
96
  @javascript
97
  Scenario: The redo question button is visible but disabled for teachers
98
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
99
    When I press "Attempt quiz"
100
    And I click on "False" "radio" in the "First question" "question"
101
    And I click on "Check" "button" in the "First question" "question"
102
    And I log out
103
    And I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher"
104
    And I follow "Attempts: 1"
105
    And I follow "Review attempt"
106
    Then the "Try another question like this one" "button" should be disabled
107
 
108
  @javascript
109
  Scenario: The redo question buttons are no longer visible after the attempt is submitted.
110
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
111
    When I press "Attempt quiz"
112
    And I click on "False" "radio" in the "First question" "question"
113
    And I click on "Check" "button" in the "First question" "question"
114
    And I press "Finish attempt ..."
115
    And I press "Submit all and finish"
116
    And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
117
    Then "Try another question like this one" "button" should not exist
118
 
119
  @javascript @_switch_window
120
  Scenario: Teachers reviewing can see all the questions attempted in a slot
121
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
122
    And I press "Attempt quiz"
123
    And I click on "False" "radio" in the "First question" "question"
124
    And I click on "Check" "button" in the "First question" "question"
125
    And I press "Try another question like this one"
126
    And I press "Finish attempt ..."
127
    And I press "Submit all and finish"
128
    And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
129
    And I log out
130
    When I am on the "Quiz 1" "mod_quiz > View" page logged in as "teacher"
131
    And I follow "Attempts: 1"
132
    And I follow "Review attempt"
133
    And I click on "1" "link" in the "First question" "question"
134
    And I switch to "reviewquestion" window
135
    Then the state of "First question" question is shown as "Incorrect"
136
    And I click on "1" "link" in the "First question" "question"
137
    And the state of "First question" question is shown as "Not complete"
138
    And I switch to the main window
139
    And the state of "First question" question is shown as "Not answered"
140
    And I should not see "Submit" in the ".history" "css_element"
141
    And I am on the "Quiz 1" "mod_quiz > Statistics report" page logged in as teacher
142
    And I follow "TF1"
143
    And "False" row "Frequency" column of "quizresponseanalysis" table should contain "100.00%"
144
    And "True" row "Frequency" column of "quizresponseanalysis" table should contain "0.00%"
145
    And "[No response]" row "Frequency" column of "quizresponseanalysis" table should contain "100.00%"
146
 
147
  @javascript @_switch_window
148
  Scenario: Teachers reviewing can switch between attempts in the review question popup
149
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as student
150
    # Create two attempts, only one of which has a redo.
151
    When I press "Attempt quiz"
152
    And I click on "False" "radio" in the "First question" "question"
153
    And I click on "Check" "button" in the "First question" "question"
154
    And I press "Try another question like this one"
155
    And I press "Finish attempt ..."
156
    And I press "Submit all and finish"
157
    And I click on "Submit all and finish" "button" in the "Submit all your answers and finish?" "dialogue"
158
    And I follow "Finish review"
159
    And I press "Re-attempt quiz"
160
    And I click on "True" "radio" in the "First question" "question"
161
    And I click on "Check" "button" in the "First question" "question"
162
    And I log out
163
    And I am on the "Quiz 1" "mod_quiz > View" page logged in as teacher
164
    And I follow "Attempts: 2"
165
    # Review the first attempt - and switch to the first question seen.
166
    And I follow "Review attempt"
167
    And I click on "1" "link" in the "First question" "question"
168
    And I switch to "reviewquestion" window
169
    And the state of "First question" question is shown as "Incorrect"
170
    # Now switch to the other quiz attempt using the link at the top, which does not have a redo.
171
    And I click on "2" "link" in the "Attempts" "table_row"
172
    Then the state of "First question" question is shown as "Correct"
173
    And I should not see "Other questions attempted here"
174
 
175
  @javascript
176
  Scenario: Redoing question 1 should save any changes to question 2 on the same page
177
    Given I am on the "Quiz 1" "mod_quiz > View" page logged in as "student"
178
    When I press "Attempt quiz"
179
    And I click on "False" "radio" in the "First question" "question"
180
    And I click on "Check" "button" in the "First question" "question"
181
    And I click on "True" "radio" in the "Second question" "question"
182
    And I press "Try another question like this one"
183
    And I click on "Check" "button" in the "Second question" "question"
184
    Then the state of "Second question" question is shown as "Correct"
185
 
186
  @javascript
187
  Scenario: Redoing questions should work with random questions as well
188
    Given the following "activities" exist:
189
      | activity | name   | intro              | course | idnumber | preferredbehaviour | canredoquestions |
190
      | quiz     | Quiz 2 | Quiz 2 description | C1     | quiz2    | immediatefeedback  | 1                |
191
    And I am on the "Quiz 2" "mod_quiz > Edit" page logged in as "admin"
192
    And I open the "last" add to quiz menu
193
    And I follow "a random question"
194
    And I press "Add random question"
195
    And user "student" has started an attempt at quiz "Quiz 2" randomised as follows:
196
      | slot | actualquestion |
197
      | 1    | TF1            |
198
    And I am on the "Quiz 2" "mod_quiz > View" page logged in as "student"
199
    When I press "Continue your attempt"
200
    And I should see "First question"
201
    And I click on "False" "radio"
202
    And I click on "Check" "button"
203
    And I press "Try another question like this one"
204
    And I should see "Second question"
205
    And "Check" "button" should exist
206
 
207
  Scenario: Teachers reviewing can see author of action in review attempt
208
    Given the following "questions" exist:
209
      | questioncategory | qtype       | name | questiontext                   | answer 1    | grade |
210
      | Test questions   | shortanswer | SA1  | Who is author of Harry Potter? | J.K.Rowling | 100%  |
211
    And the following "activities" exist:
212
      | activity | name   | intro              | course | idnumber |
213
      | quiz     | Quiz 2 | Quiz 2 description | C1     | quiz2    |
214
    And quiz "Quiz 2" contains the following questions:
215
      | question | page |
216
      | SA1      | 1    |
217
    And user "student" has attempted "Quiz 2" with responses:
218
      | slot | response    |
219
      | 1    | J.K.Rowling |
220
    And I am on the "Quiz 2" "mod_quiz > Manual grading report" page logged in as "teacher"
221
    And I follow "Also show questions that have been graded automatically"
222
    When I click on "update grades" "link" in the "SA1" "table_row"
223
    Then I set the field "Comment" to "I have adjusted your mark to 1.0"
224
    And I set the field "Mark" to "1.0"
225
    And I press "Save and show next"
226
    And I follow "Results"
227
    And I follow "Review attempt"
228
    And I should see "Teacher One" in the "I have adjusted your mark to 1.0" "table_row"