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: Edit quizzes where some questions require the previous one to have been completed
3
  In order to create quizzes where later questions can only be seen after earlier ones are answered
4
  As a teacher
5
  I need to be able to configure this on the Edit quiz page
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | teacher1 | T1        | Teacher1 | teacher1@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 |
1441 ariadna 17
    And the following "activities" exist:
18
      | activity   | name    | course | idnumber |
19
      | qbank      | Qbank 1 | C1     | qbank1   |
1 efrain 20
    And the following "question categories" exist:
1441 ariadna 21
      | contextlevel    | reference | name           |
22
      | Activity module | qbank1    | Test questions |
1 efrain 23
    And I log in as "teacher1"
24
 
25
  @javascript
26
  Scenario: The first question cannot depend on the previous (whatever is in the DB)
27
    Given the following "activities" exist:
28
      | activity   | name   | intro              | course | idnumber | preferredbehaviour |
29
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  |
30
    And the following "questions" exist:
31
      | questioncategory | qtype       | name | questiontext    |
32
      | Test questions   | truefalse   | TF1  | First question  |
33
    And quiz "Quiz 1" contains the following questions:
34
      | question | page | requireprevious |
35
      | TF1      | 1    | 1               |
36
    And I am on the "Quiz 1" "mod_quiz > Edit" page
37
    Then "be attempted" "link" should not be visible
38
    # The text "be attempted" is used as a relatively unique string in both the add and remove links.
39
 
40
  @javascript
41
  Scenario: If the second question depends on the first, that is shown
42
    Given the following "activities" exist:
43
      | activity   | name   | intro              | course | idnumber | preferredbehaviour |
44
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  |
45
    And the following "questions" exist:
46
      | questioncategory | qtype       | name | questiontext    |
47
      | Test questions   | truefalse   | TF1  | First question  |
48
      | Test questions   | truefalse   | TF2  | Second question |
49
    And quiz "Quiz 1" contains the following questions:
50
      | question | page | requireprevious |
51
      | TF1      | 1    | 0               |
52
      | TF2      | 1    | 1               |
53
    And I am on the "Quiz 1" "mod_quiz > Edit" page
54
    Then "This question cannot be attempted until the previous question has been completed." "link" should be visible
55
 
56
  @javascript
57
  Scenario: A question can depend on a random question
58
    Given the following "activities" exist:
59
      | activity   | name   | intro              | course | idnumber | preferredbehaviour |
60
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  |
61
    And the following "questions" exist:
62
      | questioncategory | qtype       | name                    | questiontext   |
63
      | Test questions   | truefalse   | TF1                     | First question |
64
      | Test questions   | random      | Random (Test questions) | 0              |
65
    And quiz "Quiz 1" contains the following questions:
66
      | question                | page | requireprevious |
67
      | Random (Test questions) | 1    | 0               |
68
      | TF1                     | 1    | 1               |
69
    And I am on the "Quiz 1" "mod_quiz > Edit" page
70
    Then "This question cannot be attempted until the previous question has been completed." "link" should be visible
71
 
72
  @javascript
73
  Scenario: The second question can be set to depend on the first
74
    Given the following "activities" exist:
75
      | activity   | name   | intro              | course | idnumber | preferredbehaviour |
76
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  |
77
    And the following "questions" exist:
78
      | questioncategory | qtype       | name | questiontext    |
79
      | Test questions   | truefalse   | TF1  | First question  |
80
      | Test questions   | truefalse   | TF2  | Second question |
81
      | Test questions   | truefalse   | TF3  | Third question  |
82
    And quiz "Quiz 1" contains the following questions:
83
      | question | page | requireprevious |
84
      | TF1      | 1    | 0               |
85
      | TF2      | 1    | 0               |
86
      | TF3      | 1    | 0               |
87
    And I am on the "Quiz 1" "mod_quiz > Edit" page
88
    When I follow "No restriction on when question 2 can be attempted • Click to change"
89
    Then "Question 2 cannot be attempted until the previous question 1 has been completed • Click to change" "link" should be visible
90
    And "No restriction on when question 3 can be attempted • Click to change" "link" should be visible
91
 
92
  @javascript
93
  Scenario: A question that did depend on the previous can be un-linked
94
    Given the following "activities" exist:
95
      | activity   | name   | intro              | course | idnumber | preferredbehaviour |
96
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  |
97
    And the following "questions" exist:
98
      | questioncategory | qtype       | name | questiontext    |
99
      | Test questions   | truefalse   | TF1  | First question  |
100
      | Test questions   | truefalse   | TF2  | Second question |
101
      | Test questions   | truefalse   | TF3  | Third question  |
102
    And quiz "Quiz 1" contains the following questions:
103
      | question | page | requireprevious |
104
      | TF1      | 1    | 0               |
105
      | TF2      | 1    | 1               |
106
      | TF3      | 1    | 1               |
107
    And I am on the "Quiz 1" "mod_quiz > Edit" page
108
    When I follow "Question 3 cannot be attempted until the previous question 2 has been completed • Click to change"
109
    Then "Question 2 cannot be attempted until the previous question 1 has been completed • Click to change" "link" should be visible
110
    And "No restriction on when question 3 can be attempted • Click to change" "link" should be visible
111
 
112
  @javascript
113
  Scenario: Question dependency cannot apply to deferred feedback quizzes so UI is hidden
114
    Given the following "activities" exist:
115
      | activity   | name   | intro              | course | idnumber | preferredbehaviour |
116
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | deferredfeedback   |
117
    And the following "questions" exist:
118
      | questioncategory | qtype       | name                    | questiontext    |
119
      | Test questions   | truefalse   | TF1                     | First question  |
120
      | Test questions   | truefalse   | TF2                     | Second question |
121
      | Test questions   | random      | Random (Test questions) | 0               |
122
    And quiz "Quiz 1" contains the following questions:
123
      | question                | page | requireprevious |
124
      | Random (Test questions) | 1    | 0               |
125
      | TF1                     | 1    | 1               |
126
      | TF2                     | 1    | 1               |
127
    And I am on the "Quiz 1" "mod_quiz > Edit" page
128
    Then "be attempted" "link" in the "TF1" "list_item" should not be visible
129
    Then "be attempted" "link" in the "TF2" "list_item" should not be visible
130
 
131
  @javascript
132
  Scenario: Question dependency cannot apply to questions in a shuffled section so UI is hidden
133
    Given the following "activities" exist:
134
      | activity   | name   | intro              | course | idnumber | preferredbehaviour | questionsperpage |
135
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  | 2                |
136
    And the following "questions" exist:
137
      | questioncategory | qtype       | name | questiontext    |
138
      | Test questions   | truefalse   | TF1  | First question  |
139
      | Test questions   | truefalse   | TF2  | Second question |
140
    And quiz "Quiz 1" contains the following questions:
141
      | question | page | requireprevious |
142
      | TF1      | 1    | 1               |
143
      | TF2      | 1    | 1               |
144
    And quiz "Quiz 1" contains the following sections:
145
      | heading   | firstslot | shuffle |
146
      | Section 1 | 1         | 1       |
147
    And I am on the "Quiz 1" "mod_quiz > Edit" page
148
    Then "be attempted" "link" in the "TF2" "list_item" should not be visible
149
 
150
  @javascript
151
  Scenario: Question dependency cannot apply to the first questions in section when the previous section is shuffled
152
    Given the following "activities" exist:
153
      | activity   | name   | intro              | course | idnumber | preferredbehaviour | questionsperpage |
154
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  | 2                |
155
    And the following "questions" exist:
156
      | questioncategory | qtype       | name | questiontext    |
157
      | Test questions   | truefalse   | TF1  | First question  |
158
      | Test questions   | truefalse   | TF2  | Second question |
159
    And quiz "Quiz 1" contains the following questions:
160
      | question | page | requireprevious |
161
      | TF1      | 1    | 1               |
162
      | TF2      | 1    | 1               |
163
    And quiz "Quiz 1" contains the following sections:
164
      | heading   | firstslot | shuffle |
165
      | Section 1 | 1         | 1       |
166
      | Section 2 | 2         | 0       |
167
    And I am on the "Quiz 1" "mod_quiz > Edit" page
168
    Then "be attempted" "link" in the "TF2" "list_item" should not be visible
169
 
170
  @javascript
171
  Scenario: Question dependency cannot apply to quizzes with sequential navigation so UI is hidden
172
    Given the following "activities" exist:
173
      | activity   | name   | intro              | course | idnumber | preferredbehaviour | navmethod  |
174
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  | sequential |
175
    And the following "questions" exist:
176
      | questioncategory | qtype       | name | questiontext    |
177
      | Test questions   | truefalse   | TF1  | First question  |
178
      | Test questions   | truefalse   | TF2  | Second question |
179
    And quiz "Quiz 1" contains the following questions:
180
      | question | page | requireprevious |
181
      | TF1      | 1    | 1               |
182
      | TF2      | 1    | 1               |
183
    And I am on the "Quiz 1" "mod_quiz > Edit" page
184
    Then "be attempted" "link" in the "TF2" "list_item" should not be visible
185
 
186
  @javascript
187
  Scenario: A question can never depend on an essay
188
    Given the following "activities" exist:
189
      | activity   | name   | intro              | course | idnumber | preferredbehaviour |
190
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  |
191
    And the following "questions" exist:
192
      | questioncategory | qtype       | name  | questiontext   |
193
      | Test questions   | essay       | Story | First question |
194
      | Test questions   | truefalse   | TF1   | First question |
195
    And quiz "Quiz 1" contains the following questions:
196
      | question | page | requireprevious |
197
      | Story    | 1    | 0               |
198
      | TF1      | 1    | 0               |
199
    And I am on the "Quiz 1" "mod_quiz > Edit" page
200
    Then "be attempted" "link" in the "TF1" "list_item" should not be visible
201
 
202
  @javascript
203
  Scenario: A question can never depend on a description
204
    Given the following "activities" exist:
205
      | activity   | name   | intro              | course | idnumber | preferredbehaviour |
206
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  |
207
    And the following "questions" exist:
208
      | questioncategory | qtype       | name | questiontext   |
209
      | Test questions   | description | Info | Read me        |
210
      | Test questions   | truefalse   | TF1  | First question |
211
    And quiz "Quiz 1" contains the following questions:
212
      | question | page | requireprevious |
213
      | Info     | 1    | 0               |
214
      | TF1      | 1    | 0               |
215
    And I am on the "Quiz 1" "mod_quiz > Edit" page
216
    Then "be attempted" "link" in the "TF1" "list_item" should not be visible
217
 
218
  @javascript
219
  Scenario: When questions are reordered, the dependency icons are updated correctly
220
    Given the following "activities" exist:
221
      | activity   | name   | intro              | course | idnumber | preferredbehaviour |
222
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    | immediatefeedback  |
223
    And the following "questions" exist:
224
      | questioncategory | qtype       | name | questiontext    |
225
      | Test questions   | truefalse   | TF1  | First question  |
226
      | Test questions   | truefalse   | TF2  | Second question |
227
      | Test questions   | truefalse   | TF3  | Third question  |
228
    And quiz "Quiz 1" contains the following questions:
229
      | question | page | requireprevious |
230
      | TF1      | 1    | 0               |
231
      | TF2      | 1    | 1               |
232
      | TF3      | 1    | 1               |
233
    And I am on the "Quiz 1" "mod_quiz > Edit" page
234
    When I move "TF1" to "After Question 3" in the quiz by clicking the move icon
235
    Then "Question 2 cannot be attempted until the previous question 1 has been completed • Click to change" "link" should be visible
236
    And "No restriction on when question 3 can be attempted • Click to change" "link" should be visible
237
    And "be attempted" "link" in the "TF2" "list_item" should not be visible