3 In order to reuse past quizzes
5 I need to remove all previous data.
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | teacher1 | Terry1 | Teacher1 | teacher1@example.com |
11 | student1 | Sam1 | Student1 | student1@example.com |
12 And the following "courses" exist:
13 | fullname | shortname | category |
15 And the following "course enrolments" exist:
16 | user | course | role |
17 | teacher1 | C1 | editingteacher |
18 | student1 | C1 | student |
19 And the following "groups" exist:
20 | name | course | idnumber |
23 And the following "question categories" exist:
24 | contextlevel | reference | name |
25 | Course | C1 | Test questions |
26 And the following "questions" exist:
27 | questioncategory | qtype | name | questiontext |
28 | Test questions | truefalse | TF1 | First question |
29 And the following "activities" exist:
30 | activity | name | intro | course | idnumber |
31 | quiz | Test quiz name | Test quiz description | C1 | quiz1 |
32 And quiz "Test quiz name" contains the following questions:
35 And user "student1" has attempted "Test quiz name" with responses:
39 Scenario: Use course reset to clear all attempt data
40 When I log in as "teacher1"
41 And I am on "Course 1" course homepage
42 And I navigate to "Reset" in current page administration
43 And I set the following fields to these values:
44 | Delete all quiz attempts | 1 |
45 And I press "Reset course"
46 And I press "Continue"
47 And I am on "Course 1" course homepage
48 And I follow "Test quiz name"
49 And I navigate to "Results" in current page administration
50 Then I should see "Attempts: 0"
53 Scenario: Use course reset to remove user overrides.
54 When I log in as "teacher1"
55 And I am on "Course 1" course homepage
56 And I follow "Test quiz name"
57 And I navigate to "User overrides" in current page administration
58 And I press "Add user override"
59 And I set the following fields to these values:
60 | Override user | Student1 |
61 | Attempts allowed | 2 |
63 And I should see "Sam1 Student1"
64 And I am on "Course 1" course homepage
65 And I navigate to "Reset" in current page administration
66 And I set the following fields to these values:
67 | Delete all user overrides | 1 |
68 And I press "Reset course"
69 And I press "Continue"
70 And I am on "Course 1" course homepage
71 And I follow "Test quiz name"
72 And I navigate to "User overrides" in current page administration
73 Then I should not see "Sam1 Student1"
75 Scenario: Use course reset to remove group overrides.
76 When I log in as "teacher1"
77 And I am on "Course 1" course homepage
78 And I follow "Test quiz name"
79 And I navigate to "Group overrides" in current page administration
80 And I press "Add group override"
81 And I set the following fields to these values:
82 | Override group | Group 1 |
83 | Attempts allowed | 2 |
85 And I should see "Group 1"
86 And I am on "Course 1" course homepage
87 And I navigate to "Reset" in current page administration
88 And I set the following fields to these values:
89 | Delete all group overrides | 1 |
90 And I press "Reset course"
91 And I press "Continue"
92 And I am on "Course 1" course homepage
93 And I follow "Test quiz name"
94 And I navigate to "Group overrides" in current page administration
95 Then I should not see "Group 1"