MDL-49324 grades: Remove unnecessary @javascript tag from tests
[moodle.git] / grade / tests / behat / grade_single_item_scales.feature
CommitLineData
1d65db8b
FM
1@core @core_grades
2Feature: View gradebook when single item scales are used
3 In order to use single item scales to grade activities
4 As an teacher
5 I need to be able to view gradebook with single item scales
6
7 Background:
8 Given I log in as "admin"
9 And I set the following administration settings values:
10 | grade_report_showranges | 1 |
11 | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural |
12 And I navigate to "Scales" node in "Site administration > Grades"
13 And I press "Add a new scale"
14 And I set the following fields to these values:
15 | Name | Singleitem |
16 | Scale | Ace! |
17 And I press "Save changes"
18 And I log out
19 And the following "courses" exist:
20 | fullname | shortname |
21 | Course 1 | C1 |
22 And the following "users" exist:
23 | username | firstname | lastname | email | idnumber |
0fe86bbd
RT
24 | teacher1 | Teacher | 1 | teacher1@example.com | t1 |
25 | student1 | Student | 1 | student1@example.com | s1 |
26 | student2 | Student | 2 | student2@example.com | s2 |
1d65db8b
FM
27 And the following "course enrolments" exist:
28 | user | course | role |
29 | teacher1 | C1 | editingteacher |
30 | student1 | C1 | student |
31 | student2 | C1 | student |
32 And the following "grade categories" exist:
33 | fullname | course |
34 | Sub category 1 | C1 |
35 And the following "activities" exist:
36 | activity | course | idnumber | name | intro | gradecategory |
37 | assign | C1 | a1 | Test assignment one | Submit something! | Sub category 1 |
38 And I log in as "teacher1"
39 And I follow "Course 1"
40 And I follow "Test assignment one"
41 And I follow "Edit settings"
42 And I expand all fieldsets
43 And I set the field "grade[modgrade_type]" to "Scale"
44 And I set the field "grade[modgrade_scale]" to "Singleitem"
45 And I press "Save and display"
46 And I follow "View/grade all submissions"
47 And I click on "Grade Student 1" "link" in the "Student 1" "table_row"
48 And I set the field "Grade" to "A"
49 And I press "Save changes"
50 And I follow "Course 1"
4887d152 51 And I navigate to "Grades" node in "Course administration"
1d65db8b
FM
52 And I navigate to "Course grade settings" node in "Grade administration > Setup"
53 And I set the field "Show weightings" to "Show"
54 And I set the field "Show contribution to course total" to "Show"
55 And I press "Save changes"
56 And I follow "Grader report"
57 And I turn editing mode on
58
1d65db8b
FM
59 Scenario: Test displaying single item scales in gradebook in aggregation method Natural
60 When I turn editing mode off
61 Then the following should exist in the "user-grades" table:
62 | -1- | -4- | -5- | -6- |
63 | Student 1 | Ace! | 1.00 | 1.00 |
64 And the following should exist in the "user-grades" table:
65 | -1- | -2- | -3- | -4- |
66 | Range | Ace!–Ace! | 0.00–1.00 | 0.00–1.00 |
67 | Overall average | Ace! | 1.00 | 1.00 |
68 And I follow "User report"
47f084c6 69 And I select "Student 1" from the "Select all or one user" singleselect
1d65db8b
FM
70 And the following should exist in the "user-grade" table:
71 | Grade item | Grade | Range | Contribution to course total |
b0c5a9c4 72 | Test assignment one | Ace! | Ace!–Ace! | 100.00 % |
bed97c39 73 | Sub category 1 total| 1.00 | 0–1 | - |
1d65db8b 74 | Course total | 1.00 | 0–1 | - |
47f084c6 75 And I select "Student 2" from the "Select all or one user" singleselect
1d65db8b
FM
76 And the following should exist in the "user-grade" table:
77 | Grade item | Grade | Range | Contribution to course total |
5dd0cb7b 78 | Test assignment one | - | Ace!–Ace! | - |
bed97c39 79 | Sub category 1 total| - | 0–1 | - |
1d65db8b 80 | Course total | - | 0–1 | - |
47f084c6 81 And I select "Gradebook setup" from the "jump" singleselect
1d65db8b
FM
82 And the following should exist in the "grade_edit_tree_table" table:
83 | Name | Max grade |
84 | Test assignment one | 1.00 |
bed97c39 85 | Sub category 1 total| 1.00 |
1d65db8b
FM
86 | Course total | 1.00 |
87
1d65db8b
FM
88 Scenario Outline: Test displaying single item scales in gradebook in all other aggregation methods
89 When I follow "Edit Course 1"
90 And I set the field "Aggregation" to "<aggregation>"
91 And I press "Save changes"
92 And I follow "Edit Sub category 1"
47f084c6
AN
93 And I set the following fields to these values:
94 | Aggregation | <aggregation> |
95 | Category name | Sub category (<aggregation>) |
1d65db8b
FM
96 And I press "Save changes"
97 And I turn editing mode off
98 Then the following should exist in the "user-grades" table:
99 | -1- | -4- | -5- | -6- |
100 | Student 1 | Ace! | <cattotal1> | <coursetotal1> |
101 | Student 2 | - | - | - |
102 And the following should exist in the "user-grades" table:
103 | -1- | -2- | -3- | -4- |
104 | Range | Ace!–Ace! | 0.00–100.0 | 0.00–100.00 |
105 | Overall average | Ace! | <catavg> | <overallavg> |
106 And I follow "User report"
47f084c6 107 And I select "Student 1" from the "Select all or one user" singleselect
1d65db8b 108 And the following should exist in the "user-grade" table:
bed97c39
RT
109 | Grade item | Grade | Range | Contribution to course total |
110 | Test assignment one | Ace! | Ace!–Ace! | <contrib1> |
111 | Sub category (<aggregation>) total<aggregation>. | <cattotal1> | 0–100 | - |
112 | Course total<aggregation>. | <coursetotal1> | 0–100 | - |
47f084c6 113 And I select "Gradebook setup" from the "jump" singleselect
1d65db8b 114 And the following should exist in the "grade_edit_tree_table" table:
47f084c6
AN
115 | Name | Max grade |
116 | Test assignment one | Ace! (1) |
41e62a90 117 | Sub category (<aggregation>) total<aggregation>. | 100.00 |
47f084c6 118 | Course total<aggregation>. | 100.00 |
1d65db8b
FM
119
120 Examples:
121 | aggregation | contrib1 | cattotal1 | coursetotal1 | catavg | overallavg |
b0c5a9c4 122 | Mean of grades | 100.00 % | 100.00 | 100.00 | 100.00 | 100.00 |
e1c5d661 123 | Weighted mean of grades | 0.00 % | 100.00 | 100.00 | 100.00 | 100.00 |
b0c5a9c4
DW
124 | Simple weighted mean of grades | 0.00 % | - | - | - | - |
125 | Mean of grades (with extra credits) | 100.00 % | 100.00 | 100.00 | 100.00 | 100.00 |
126 | Median of grades | 100.00 % | 100.00 | 100.00 | 100.00 | 100.00 |
127 | Lowest grade | 100.00 % | 100.00 | 100.00 | 100.00 | 100.00 |
128 | Highest grade | 100.00 % | 100.00 | 100.00 | 100.00 | 100.00 |
129 | Mode of grades | 100.00 % | 100.00 | 100.00 | 100.00 | 100.00 |