1 |
efrain |
1 |
@mod @mod_h5pactivity @core_h5p @_file_upload @_switch_iframe
|
|
|
2 |
Feature: Change grading options in an H5P activity
|
|
|
3 |
In order to let students do a H5P attempt
|
|
|
4 |
As a teacher
|
|
|
5 |
I need to define what students attempts are used for grading
|
|
|
6 |
|
|
|
7 |
Background:
|
|
|
8 |
Given the following "users" exist:
|
|
|
9 |
| username | firstname | lastname | email |
|
|
|
10 |
| teacher1 | Teacher | 1 | teacher1@example.com |
|
|
|
11 |
| student1 | Student | 1 | student1@example.com |
|
|
|
12 |
And the following "courses" exist:
|
|
|
13 |
| fullname | shortname | category |
|
|
|
14 |
| Course 1 | C1 | 0 |
|
|
|
15 |
And the following "course enrolments" exist:
|
|
|
16 |
| user | course | role |
|
|
|
17 |
| teacher1 | C1 | editingteacher |
|
|
|
18 |
| student1 | C1 | student |
|
|
|
19 |
And the following "permission overrides" exist:
|
|
|
20 |
| capability | permission | role | contextlevel | reference |
|
|
|
21 |
| moodle/h5p:updatelibraries | Allow | editingteacher | System | |
|
|
|
22 |
And the following "activity" exists:
|
|
|
23 |
| activity | h5pactivity |
|
|
|
24 |
| course | C1 |
|
|
|
25 |
| name | Awesome H5P package |
|
|
|
26 |
| packagefilepath | h5p/tests/fixtures/multiple-choice-2-6.h5p |
|
|
|
27 |
And the following "mod_h5pactivity > attempts" exist:
|
|
|
28 |
| user | h5pactivity | attempt | interactiontype | rawscore | maxscore | duration | completion | success |
|
|
|
29 |
| student1 | Awesome H5P package | 1 | choice | 0 | 1 | 4 | 1 | 0 |
|
|
|
30 |
| student1 | Awesome H5P package | 2 | choice | 1 | 1 | 4 | 1 | 1 |
|
|
|
31 |
| student1 | Awesome H5P package | 3 | choice | 0 | 1 | 4 | 1 | 0 |
|
|
|
32 |
|
|
|
33 |
@javascript
|
|
|
34 |
Scenario: Default grading is max attempt grade
|
|
|
35 |
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
|
|
|
36 |
And I expand all fieldsets
|
|
|
37 |
And the field "Grading method" matches value "Highest grade"
|
|
|
38 |
And I click on "Save and return to course" "button"
|
|
|
39 |
When I navigate to "View > User report" in the course gradebook
|
|
|
40 |
And I click on "Student 1" in the "user" search widget
|
|
|
41 |
Then the following should exist in the "user-grade" table:
|
|
|
42 |
| Grade item | Grade | Percentage |
|
|
|
43 |
| Awesome H5P package | 100.00 | 100.00 % |
|
|
|
44 |
|
|
|
45 |
@javascript
|
|
|
46 |
Scenario: Change setting to first attempt
|
|
|
47 |
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
|
|
|
48 |
When I set the following fields to these values:
|
|
|
49 |
| Grading method | First attempt |
|
|
|
50 |
And I click on "Save and return to course" "button"
|
|
|
51 |
And I navigate to "View > User report" in the course gradebook
|
|
|
52 |
And I click on "Student 1" in the "user" search widget
|
|
|
53 |
Then the following should exist in the "user-grade" table:
|
|
|
54 |
| Grade item | Grade | Percentage |
|
|
|
55 |
| Awesome H5P package | 0.00 | 0.00 % |
|
|
|
56 |
|
|
|
57 |
@javascript
|
|
|
58 |
Scenario: Change setting to last attempt
|
|
|
59 |
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
|
|
|
60 |
When I set the following fields to these values:
|
|
|
61 |
| Grading method | Last attempt |
|
|
|
62 |
And I click on "Save and return to course" "button"
|
|
|
63 |
And I navigate to "View > User report" in the course gradebook
|
|
|
64 |
And I click on "Student 1" in the "user" search widget
|
|
|
65 |
Then the following should exist in the "user-grade" table:
|
|
|
66 |
| Grade item | Grade | Percentage |
|
|
|
67 |
| Awesome H5P package | 0.00 | 0.00 % |
|
|
|
68 |
|
|
|
69 |
@javascript
|
|
|
70 |
Scenario: Change setting to average attempt
|
|
|
71 |
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
|
|
|
72 |
When I set the following fields to these values:
|
|
|
73 |
| Grading method | Average grade |
|
|
|
74 |
And I click on "Save and return to course" "button"
|
|
|
75 |
And I navigate to "View > User report" in the course gradebook
|
|
|
76 |
And I click on "Student 1" in the "user" search widget
|
|
|
77 |
Then the following should exist in the "user-grade" table:
|
|
|
78 |
| Grade item | Grade | Percentage |
|
|
|
79 |
| Awesome H5P package | 33.33 | 33.33 % |
|
|
|
80 |
|
|
|
81 |
@javascript
|
|
|
82 |
Scenario: Change setting to manual grading
|
|
|
83 |
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
|
|
|
84 |
When I set the following fields to these values:
|
|
|
85 |
| Grading method | Don't calculate a grade |
|
|
|
86 |
And I click on "Save and return to course" "button"
|
|
|
87 |
And I navigate to "View > User report" in the course gradebook
|
|
|
88 |
And I click on "Student 1" in the "user" search widget
|
|
|
89 |
Then the following should exist in the "user-grade" table:
|
|
|
90 |
| Grade item | Grade | Percentage |
|
|
|
91 |
| Awesome H5P package | - | - |
|
|
|
92 |
|
|
|
93 |
@javascript
|
|
|
94 |
Scenario: Disable tracking
|
|
|
95 |
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
|
|
|
96 |
When I set the following fields to these values:
|
|
|
97 |
| Enable attempt tracking | No |
|
|
|
98 |
And I click on "Save and return to course" "button"
|
|
|
99 |
And I navigate to "View > User report" in the course gradebook
|
|
|
100 |
And I click on "Student 1" in the "user" search widget
|
|
|
101 |
Then the following should exist in the "user-grade" table:
|
|
|
102 |
| Grade item | Grade | Percentage |
|
|
|
103 |
| Awesome H5P package | - | - |
|
|
|
104 |
|
|
|
105 |
@javascript
|
|
|
106 |
Scenario: Reescale existing grades changing the maximum grade
|
|
|
107 |
# First we set to average and recalculate grades.
|
|
|
108 |
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
|
|
|
109 |
When I set the following fields to these values:
|
|
|
110 |
| Grading method | Average grade |
|
|
|
111 |
And I click on "Save and return to course" "button"
|
|
|
112 |
And I navigate to "View > User report" in the course gradebook
|
|
|
113 |
And I click on "Student 1" in the "user" search widget
|
|
|
114 |
Then the following should exist in the "user-grade" table:
|
|
|
115 |
| Grade item | Grade | Range | Percentage |
|
|
|
116 |
| Awesome H5P package | 33.33 | 0–100 | 33.33 % |
|
|
|
117 |
|
|
|
118 |
# Now we modify the maximum grade with rescaling.
|
|
|
119 |
And I am on the "Awesome H5P package" "h5pactivity activity editing" page
|
|
|
120 |
And I set the following fields to these values:
|
|
|
121 |
| Rescale existing grades | Yes |
|
|
|
122 |
| Maximum grade | 50 |
|
|
|
123 |
And I click on "Save and return to course" "button"
|
|
|
124 |
And I navigate to "View > User report" in the course gradebook
|
|
|
125 |
And I click on "Student 1" in the "user" search widget
|
|
|
126 |
Then the following should exist in the "user-grade" table:
|
|
|
127 |
| Grade item | Grade | Range | Percentage |
|
|
|
128 |
| Awesome H5P package | 16.67 | 0–50 | 33.33 % |
|
|
|
129 |
|
|
|
130 |
@javascript
|
|
|
131 |
Scenario: Change maximum grade without rescaling grade
|
|
|
132 |
# First we set to average and recalculate grades.
|
|
|
133 |
Given I am on the "Awesome H5P package" "h5pactivity activity editing" page logged in as teacher1
|
|
|
134 |
When I set the following fields to these values:
|
|
|
135 |
| Grading method | Average grade |
|
|
|
136 |
And I click on "Save and return to course" "button"
|
|
|
137 |
And I navigate to "View > User report" in the course gradebook
|
|
|
138 |
And I click on "Student 1" in the "user" search widget
|
|
|
139 |
Then the following should exist in the "user-grade" table:
|
|
|
140 |
| Grade item | Grade | Range | Percentage |
|
|
|
141 |
| Awesome H5P package | 33.33 | 0–100 | 33.33 % |
|
|
|
142 |
|
|
|
143 |
# Now we modify the maximum grade with rescaling.
|
|
|
144 |
When I am on the "Awesome H5P package" "h5pactivity activity editing" page
|
|
|
145 |
And I set the following fields to these values:
|
|
|
146 |
| Rescale existing grades | No |
|
|
|
147 |
| Maximum grade | 50 |
|
|
|
148 |
And I click on "Save and return to course" "button"
|
|
|
149 |
And I navigate to "View > User report" in the course gradebook
|
|
|
150 |
And I click on "Student 1" in the "user" search widget
|
|
|
151 |
Then the following should exist in the "user-grade" table:
|
|
|
152 |
| Grade item | Grade | Range | Percentage |
|
|
|
153 |
| Awesome H5P package | 33.33 | 0–50 | 66.67 % |
|