1 |
efrain |
1 |
@mod @mod_quiz @quiz @quiz_statistics
|
|
|
2 |
Feature: Robustness of the statistics calculations with missing qusetions
|
|
|
3 |
In order to be able to install and uninstall plugins
|
|
|
4 |
As a teacher
|
|
|
5 |
I need the statistics to work even if a question type has been uninstalled
|
|
|
6 |
|
|
|
7 |
Scenario: Statistics can be calculated even after a question type has been uninstalled
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username |
|
|
|
10 |
| teacher |
|
|
|
11 |
| student |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname |
|
|
|
14 |
| Course 1 | C1 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher | C1 | editingteacher |
|
|
|
18 |
| student | 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 |
|
|
|
24 |
| Test questions | truefalse | Test question 1 |
|
|
|
25 |
| Test questions | truefalse | Test question 2 |
|
|
|
26 |
And the following "activities" exist:
|
|
|
27 |
| activity | name | course | idnumber |
|
|
|
28 |
| quiz | Quiz 1 | C1 | quiz1 |
|
|
|
29 |
And quiz "Quiz 1" contains the following questions:
|
|
|
30 |
| question | page |
|
|
|
31 |
| Test question 1 | 1 |
|
|
|
32 |
| Test question 2 | 1 |
|
|
|
33 |
And user "student" has attempted "Quiz 1" with responses:
|
|
|
34 |
| slot | response |
|
|
|
35 |
| 1 | True |
|
|
|
36 |
| 2 | True |
|
|
|
37 |
And question "Test question 1" is changed to simulate being of an uninstalled type
|
|
|
38 |
And question "Test question 2" no longer exists in the database
|
|
|
39 |
|
|
|
40 |
When I am on the "Quiz 1" "mod_quiz > Statistics report" page logged in as teacher
|
|
|
41 |
|
|
|
42 |
Then I should see "Quiz structure analysis"
|
|
|
43 |
And "1" row "Question name" column of "questionstatistics" table should contain "Missing question"
|
|
|
44 |
And "1" row "Attempts" column of "questionstatistics" table should contain "1"
|
|
|
45 |
And "1" row "Intended weight" column of "questionstatistics" table should contain "50.00%"
|
|
|
46 |
And "2" row "Question name" column of "questionstatistics" table should contain "Missing question"
|
|
|
47 |
And "2" row "Attempts" column of "questionstatistics" table should contain "1"
|
|
|
48 |
And "2" row "Intended weight" column of "questionstatistics" table should contain "50.00%"
|