weekly release 2.9dev
[moodle.git] / grade / tests / behat / grade_scales_aggregation.feature
CommitLineData
37fc69a0
FM
1@core @core_grades
2Feature: Control the aggregation of the scales
3 In order to use control the aggregation of the scales
4 As an admin
5 I can change use administration setting
6
7 Background:
8 Given the following "courses" exist:
9 | fullname | shortname |
10 | Course 1 | C1 |
11 And the following "users" exist:
12 | username | firstname | lastname | email | idnumber |
13 | teacher1 | Teacher | 1 | teacher1@asd.com | t1 |
14 | student1 | Student | 1 | student1@asd.com | s1 |
15 And the following "course enrolments" exist:
16 | user | course | role |
17 | teacher1 | C1 | editingteacher |
18 | student1 | C1 | student |
19 And I log in as "admin"
20 And I set the following administration settings values:
21 | 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 |
22 | grade_report_user_showcontributiontocoursetotal | 1 |
23 And I navigate to "Scales" node in "Site administration > Grades"
24 And I press "Add a new scale"
25 And I set the following fields to these values:
26 | Name | Letterscale |
27 | Scale | F,D,C,B,A |
28 And I press "Save changes"
29 And the following "grade items" exist:
30 | itemname | course |
31 | Grade me | C1 |
32 And the following "grade items" exist:
33 | itemname | course | scale |
34 | Scale me | C1 | Letterscale |
35
36 @javascript
37 Scenario Outline: Scales can be exluded from aggregation
38 Given I set the following administration settings values:
39 | grade_includescalesinaggregation | 0 |
40 And I log out
41 And I log in as "teacher1"
42 And I follow "Course 1"
43 And I follow "Grades"
44 And I turn editing mode on
45 When I give the grade "10" to the user "Student 1" for the grade item "Grade me"
46 And I give the grade "B" to the user "Student 1" for the grade item "Scale me"
47 And I press "Save changes"
48 And I set the following settings for grade item "Course 1":
49 | Aggregation | <aggregation> |
50 And I follow "User report"
51 And I set the field "Select all or one user" to "Student 1"
52 Then the following should exist in the "user-grade" table:
53 | Grade item | Grade | Percentage | Contribution to course total |
54 | Grade me | 10.00 | 10.00 % | <gradecontrib> |
55 | Scale me | B | 75.00 % | <scalecontrib> |
56 | Course total<totalstr> | <coursetotal> | <coursepc> | - |
57 And I log out
58 And I log in as "admin"
59 And I set the following administration settings values:
60 | grade_includescalesinaggregation | 1 |
61 And I log out
62 And I log in as "teacher1"
63 And I follow "Course 1"
64 And I follow "Grades"
65 And I follow "User report"
66 And I set the field "Select all or one user" to "Student 1"
67 And the following should exist in the "user-grade" table:
68 | Grade item | Grade | Percentage | Contribution to course total |
69 | Grade me | 10.00 | 10.00 % | <gradecontrib2> |
70 | Scale me | B | 75.00 % | <scalecontrib2> |
71 | Course total<totalstr> | <coursetotal2> | <coursepc2> | - |
72
73 Examples:
08f289c6 74 | aggregation | totalstr | coursetotal | coursepc | gradecontrib | scalecontrib | coursetotal2 | coursepc2 | gradecontrib2 | scalecontrib2 |
37fc69a0
FM
75 | Natural | | 10.00 | 10.00 % | 10.00 | 0.00 | 14.00 | 13.33 % | 9.52 % | 3.81 % |
76 | Mean of grades | Mean of grades. | 10.00 | 10.00 % | 10.00 | 0.00 | 42.50 | 42.50 % | 5.00 % | 37.50 % |
77 | Weighted mean of grades | Weighted mean of grades. | 10.00 | 10.00 % | 10.00 | 0.00 | 42.50 | 42.50 % | 5.00 % | 37.50 % |
78 | Simple weighted mean of grades | Simple weighted mean of grades. | 10.00 | 10.00 % | 10.00 | 0.00 | 12.50 | 12.50 % | 9.62 % | 2.88 % |
79 | Mean of grades (with extra credits) | Mean of grades (with extra credits). | 10.00 | 10.00 % | 10.00 | 0.00 | 42.50 | 42.50 % | 5.00 % | 37.50 % |
80 | Median of grades | Median of grades. | 10.00 | 10.00 % | 10.00 | 0.00 | 42.50 | 42.50 % | 5.00 % | 37.50 % |
81 | Lowest grade | Lowest grade. | 10.00 | 10.00 % | 10.00 | 0.00 | 10.00 | 10.00 % | 10.00 % | 0.00 % |
82 | Highest grade | Highest grade. | 10.00 | 10.00 % | 10.00 | 0.00 | 75.00 | 75.00 % | 0.00 % | 75.00 % |
83 | Mode of grades | Mode of grades. | 10.00 | 10.00 % | 10.00 | 0.00 | 75.00 | 75.00 % | 0.00 % | 75.00 % |
84
85 @javascript
86 Scenario: Weights of scales cannot be edited when they are not aggregated
87 Given I set the following administration settings values:
88 | grade_includescalesinaggregation | 0 |
89 And I log out
90 And I log in as "teacher1"
91 And I follow "Course 1"
92 And I follow "Grades"
93 And I turn editing mode on
94 When I set the following settings for grade item "Course 1":
95 | Aggregation | Natural |
96 And I navigate to "Categories and items" node in "Grade administration > Setup"
97 And I set the field "Override weight of Grade me" to "1"
98 Then the field "Override weight of Grade me" matches value "100.00"
99 And I click on "Edit" "link" in the "Scale me" "table_row"
100 And I click on "Edit settings" "link" in the "Scale me" "table_row"
101 And I follow "Show more..."
102 And I should not see "Weight adjusted"
103 And I should not see "Weight"
104 And I log out
105 And I log in as "admin"
106 And I set the following administration settings values:
107 | grade_includescalesinaggregation | 1 |
108 And I log out
109 And I log in as "teacher1"
110 And I follow "Course 1"
111 And I follow "Grades"
112 And I navigate to "Categories and items" node in "Grade administration > Setup"
113 And I set the field "Override weight of Grade me" to "1"
114 And the field "Override weight of Grade me" matches value "95.238"
115 And I set the field "Override weight of Scale me" to "1"
116 And the field "Override weight of Scale me" matches value "4.8"
117 And I click on "Edit" "link" in the "Scale me" "table_row"
118 And I click on "Edit settings" "link" in the "Scale me" "table_row"
119 And I follow "Show more..."
120 And I should see "Weight adjusted"
08f289c6 121 And I should see "Weight"