mirrored from git://git.moodle.org/moodle.git
/
grade_point_maximum.feature
106 lines (99 loc) · 5.02 KB
/
grade_point_maximum.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
@core @core_grades
Feature: We can change the grading type and maximum grade point values
In order to verify that we can change the system-level maximum grade point value
As an admin
I need to modify the system maximum grade point and ensure that activities can use the full range.
I need to ensure that using scales for activities still works correctly.
I need to ensure that the maximum grade point value is enforced for new and existing activities.
Background:
Given the following "courses" exist:
| fullname | shortname | category | format |
| Course 1 | C1 | 0 | topics |
Given the following "activities" exist:
| activity | course | idnumber | name | intro |
| assign | C1 | assign1| Test Assignment 1 | Test Assignment 1 |
And I log in as "admin"
And I navigate to "General settings" node in "Site administration > Grades"
And I set the following fields to these values:
| Grade point maximum | 900 |
| Grade point default | 800 |
And I press "Save changes"
And I am on site homepage
And I follow "Course 1"
@javascript
Scenario: Validate that switching the type of grading used correctly disables input form elements
When I follow "Test Assignment 1"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Point"
Then the "Scale" "select" should be disabled
And the "Maximum grade" "field" should be enabled
And I set the field "grade[modgrade_type]" to "Scale"
And the "Maximum grade" "field" should be disabled
Then the "Scale" "select" should be enabled
And I set the field "grade[modgrade_type]" to "None"
Then the "Scale" "select" should be disabled
And the "Maximum grade" "field" should be disabled
And I press "Save and return to course"
@javascript
Scenario: Create an activity with a maximum grade point value less than the system maximum
When I follow "Test Assignment 1"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "point"
And I set the field "grade[modgrade_point]" to "600"
And I press "Save and display"
And I click on "Edit settings" "link" in the "Administration" "block"
Then the field "grade[modgrade_point]" matches value "600"
And the "Scale" "select" should be disabled
And I press "Save and return to course"
@javascript
Scenario: Create an activity with a scale as the grade type
When I follow "Test Assignment 1"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "Separate and Connected ways of knowing"
And I press "Save and display"
And I click on "Edit settings" "link" in the "Administration" "block"
Then the field "grade[modgrade_scale]" matches value "Separate and Connected ways of knowing"
And the "Maximum grade" "field" should be disabled
And I press "Save and return to course"
@javascript
Scenario: Create an activity with no grade as the grade type
When I follow "Test Assignment 1"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "None"
And I press "Save and display"
And I click on "Edit settings" "link" in the "Administration" "block"
And the "Scale" "select" should be disabled
And the "Maximum grade" "field" should be disabled
And I press "Save and return to course"
Scenario: Create an activity with a maximum grade point value higher than the system maximum
When I follow "Test Assignment 1"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Point"
And I set the field "grade[modgrade_point]" to "20000"
And I press "Save and display"
Then I should see "Invalid grade value. This must be an integer between 1 and 900"
And I press "Cancel"
Scenario: Create an activity with a valid maximum grade point and then change the system maximum to be lower
When I follow "Test Assignment 1"
And I click on "Edit settings" "link" in the "Administration" "block"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "point"
And I set the field "grade[modgrade_point]" to "600"
And I press "Save and display"
And I navigate to "General settings" node in "Site administration > Grades"
And I set the following fields to these values:
| Grade point maximum | 100 |
And I press "Save changes"
And I am on site homepage
And I follow "Course 1"
And I follow "Test Assignment 1"
And I click on "Edit settings" "link" in the "Administration" "block"
And I press "Save and display"
Then I should see "Invalid grade value. This must be an integer between 1 and 100"
And I press "Cancel"