Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@qbank @qbank_statistics
2
Feature: Show statistics in question bank
3
 
4
  Background:
5
    Given the following "courses" exist:
6
      | fullname | shortname | category |
7
      | Course 1 | C1        | 0        |
8
    And the following "users" exist:
9
      | username | firstname | lastname | email                |
10
      | student1 | user1     | Student1 | student1@example.com |
11
      | student2 | user2     | Student2 | student2@example.com |
12
      | student3 | user3     | Student3 | student3@example.com |
13
      | student4 | user4     | Student4 | student4@example.com |
14
      | student5 | user5     | student5 | student5@example.com |
15
    And the following "course enrolments" exist:
16
      | user     | course | role           |
17
      | student1 | C1     | student        |
18
      | student2 | C1     | student        |
19
    And the following "question categories" exist:
20
      | contextlevel | reference | name           |
21
      | Course       | C1        | Test questions |
22
    And the following "questions" exist:
23
      | questioncategory | qtype       | name  | questiontext    |
24
      | Test questions   | truefalse   | TF1   | First question  |
25
      | Test questions   | truefalse   | TF2   | Second question |
26
      | Test questions   | truefalse   | TF3   | Third question  |
27
      | Test questions   | truefalse   | TF4   | Fourth question |
28
    And the following "activities" exist:
29
      | activity   | name   | intro              | course | idnumber |
30
      | quiz       | Quiz 1 | Quiz 1 description | C1     | quiz1    |
31
      | quiz       | Quiz 2 | Quiz 2 description | C1     | quiz2    |
32
    And quiz "Quiz 1" contains the following questions:
33
      | question | page | maxmark |
34
      | TF1      | 1    | 1.0     |
35
      | TF2      | 1    | 1.0     |
36
      | TF3      | 1    | 1.0     |
37
      | TF4      | 1    | 1.0     |
38
    And quiz "Quiz 2" contains the following questions:
39
      | question | page | maxmark |
40
      | TF2      | 1    | 1.0     |
41
      | TF3      | 1    | 1.0     |
42
    And user "student1" has attempted "Quiz 1" with responses:
43
      | slot | response |
44
      |   1  | False    |
45
      |   2  | False    |
46
      |   3  | False    |
47
      |   4  | False    |
48
    And user "student2" has attempted "Quiz 1" with responses:
49
      | slot | response |
50
      |   1  | True     |
51
      |   2  | True     |
52
      |   3  | True     |
53
      |   4  | True     |
54
    And user "student3" has attempted "Quiz 1" with responses:
55
      | slot | response |
56
      |   1  | True     |
57
      |   2  | False    |
58
      |   3  | False    |
59
      |   4  | True     |
60
    And user "student4" has attempted "Quiz 1" with responses:
61
      | slot | response |
62
      |   1  | False    |
63
      |   2  | True     |
64
      |   3  | True     |
65
      |   4  | False    |
66
 
67
  Scenario: View facility index in question bank
68
    Given user "student1" has attempted "Quiz 2" with responses:
69
      | slot | response |
70
      |   1  | True    |
71
      |   2  | True    |
72
    And user "student2" has attempted "Quiz 2" with responses:
73
      | slot | response |
74
      | 1    | True     |
75
      | 2    | True     |
76
    And I run pending statistics recalculation tasks
77
    When I am on the "Course 1" "core_question > course question bank" page logged in as "admin"
78
    Then I should see "50.00%" in the "TF1" "table_row"
79
    And I should see "75.00%" in the "TF2" "table_row"
80
    And I should see "75.00%" in the "TF3" "table_row"
81
    And I should see "50.00%" in the "TF4" "table_row"
82
 
83
  Scenario: View discriminative efficiency in question bank
84
    Given user "student1" has attempted "Quiz 2" with responses:
85
      | slot | response |
86
      | 1    | False    |
87
      | 2    | False    |
88
    And user "student2" has attempted "Quiz 2" with responses:
89
      | slot | response |
90
      | 1    | True     |
91
      | 2    | True     |
92
    And I run pending statistics recalculation tasks
93
    When I am on the "Course 1" "core_question > course question bank" page logged in as "admin"
94
    Then I should see "50.00%" in the "TF1" "table_row"
95
    And I should see "75.00%" in the "TF2" "table_row"
96
    And I should see "75.00%" in the "TF3" "table_row"
97
    And I should see "50.00%" in the "TF4" "table_row"
98
 
99
  Scenario: View discrimination index in question bank, good questions
100
    Given user "student1" has attempted "Quiz 2" with responses:
101
      | slot | response |
102
      | 1    | False    |
103
      | 2    | False    |
104
    And user "student2" has attempted "Quiz 2" with responses:
105
      | slot | response |
106
      | 1    | True     |
107
      | 2    | True     |
108
    And I run pending statistics recalculation tasks
109
    When I am on the "Course 1" "core_question > course question bank" page logged in as "admin"
110
    Then I should see "Likely" in the "TF1" "table_row"
111
    And I should see "Unlikely" in the "TF2" "table_row"
112
    And I should see "Unlikely" in the "TF3" "table_row"
113
    And I should see "Likely" in the "TF4" "table_row"
114
    And I should see "Likely" in the ".alert-warning" "css_element"
115
    And I should see "Unlikely" in the ".alert-success" "css_element"
116
 
117
  Scenario: View discrimination index in question bank, bad questions
118
    Given user "student1" has attempted "Quiz 2" with responses:
119
      | slot | response |
120
      | 1    | True     |
121
      | 2    | True     |
122
    And user "student2" has attempted "Quiz 2" with responses:
123
      | slot | response |
124
      | 1    | False    |
125
      | 2    | True     |
126
    And user "student3" has attempted "Quiz 2" with responses:
127
      | slot | response |
128
      | 1    | True     |
129
      | 2    | False    |
130
    And I run pending statistics recalculation tasks
131
    When I am on the "Course 1" "core_question > course question bank" page logged in as "admin"
132
    Then I should see "Likely" in the "TF1" "table_row"
133
    And I should see "Very likely" in the "TF2" "table_row"
134
    And I should see "Very likely" in the "TF3" "table_row"
135
    And I should see "Likely" in the "TF4" "table_row"
136
    And I should see "Very likely" in the ".alert-danger" "css_element"
137
    And I should see "Likely" in the ".alert-warning" "css_element"
138
 
139
  Scenario: View discrimination index in question bank for bad multichoice questions
140
    Given the following "courses" exist:
141
      | fullname | shortname | category |
142
      | Course 2 | C2        | 0        |
143
    And the following "course enrolments" exist:
144
      | user     | course | role           |
145
      | student1 | C2     | student        |
146
      | student2 | C2     | student        |
147
      | student3 | C2     | student        |
148
      | student4 | C2     | student        |
149
      | student5 | C2     | student        |
150
    And the following "activities" exist:
151
      | activity   | name   | course | idnumber |
152
      | quiz       | Quiz 3 | C2     | quiz3    |
153
    And the following "question categories" exist:
154
      | contextlevel    | reference | name           |
155
      | Course          | C2        | Quiz questions |
156
    And the following "questions" exist:
157
      | questioncategory | qtype       | template    | name |
158
      | Quiz questions   | multichoice | one_of_four | MCA  |
159
      | Quiz questions   | multichoice | one_of_four | MCB  |
160
      | Quiz questions   | multichoice | one_of_four | MCC  |
161
      | Quiz questions   | multichoice | one_of_four | MCD  |
162
      | Quiz questions   | multichoice | one_of_four | MCE  |
163
    And quiz "Quiz 3" contains the following questions:
164
      | question | page | maxmark |
165
      | MCA      | 1    | 1.0     |
166
      | MCB      | 1    | 1.0     |
167
      | MCC      | 1    | 1.0     |
168
      | MCD      | 1    | 1.0     |
169
      | MCE      | 1    | 1.0     |
170
    # student1 answers all correctly
171
    And user "student1" has attempted "Quiz 3" with responses:
172
      | slot | response |
173
      | 1    | One      |
174
      | 2    | One      |
175
      | 3    | One      |
176
      | 4    | One      |
177
      | 5    | One      |
178
    # student2 answers A and B correctly, C, D and E incorrectly
179
    And user "student2" has attempted "Quiz 3" with responses:
180
      | slot | response |
181
      | 1    | One      |
182
      | 2    | One      |
183
      | 3    | Two      |
184
      | 4    | Two      |
185
      | 5    | Two      |
186
    # student3 answers A, D and E correctly, B and C incorrectly
187
    And user "student3" has attempted "Quiz 3" with responses:
188
      | slot | response |
189
      | 1    | One      |
190
      | 2    | Two      |
191
      | 3    | Two      |
192
      | 4    | One      |
193
      | 5    | One      |
194
    # student4 answers A and D correctly, B, C and E incorrectly
195
    And user "student4" has attempted "Quiz 3" with responses:
196
      | slot | response |
197
      | 1    | One      |
198
      | 2    | Two      |
199
      | 3    | Two      |
200
      | 4    | One      |
201
      | 5    | Two      |
202
    # student5 answers E correctly, B, C, D and A incorrectly
203
    And user "student5" has attempted "Quiz 3" with responses:
204
      | slot | response |
205
      | 1    | Two      |
206
      | 2    | Two      |
207
      | 3    | Two      |
208
      | 4    | Two      |
209
      | 5    | One      |
210
    And I run pending statistics recalculation tasks
211
    # Confirm the "Needs checking?" column matches the expected values based on students' answers
212
    When I am on the "Quiz 3" "mod_quiz > question bank" page logged in as "admin"
213
    Then "Likely" "text" should exist in the "MCA" "table_row"
214
    And "Very likely" "text" should exist in the "MCB" "table_row"
215
    And "Unlikely" "text" should exist in the "MCC" "table_row"
216
    And "Likely" "text" should exist in the "MCD" "table_row"
217
    And "Very likely" "text" should exist in the "MCE" "table_row"