MDL-47253 core_grades: set def aggregation method to Natural

Part of: MDL-46576
This commit is contained in:
Marina Glancy
2014-10-03 13:55:24 +08:00
committed by Adrian Greeve
parent c529f4b30f
commit 313e975349
3 changed files with 30 additions and 5 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ if (has_capability('moodle/grade:manage', $systemcontext)
$defaultvisible = array(GRADE_AGGREGATE_SUM);
$defaults = array('value'=>GRADE_AGGREGATE_WEIGHTED_MEAN2, 'forced'=>false, 'adv'=>false);
$defaults = array('value' => GRADE_AGGREGATE_SUM, 'forced' => false, 'adv' => false);
$temp->add(new admin_setting_gradecat_combo('grade_aggregation', new lang_string('aggregation', 'grades'), new lang_string('aggregation_help', 'grades'), $defaults, $options));
$temp->add(new admin_setting_configmultiselect('grade_aggregations_visible', new lang_string('aggregationsvisible', 'grades'),
@@ -101,6 +101,8 @@ Feature: We can understand the gradebook user report
Scenario: Simple weighted mean of grades aggregation
And I set the following settings for grade item "Course 1":
| Aggregation | Simple weighted mean of grades |
And I set the following settings for grade item "Sub category":
| Aggregation | Simple weighted mean of grades |
And I set the following settings for grade item "Test assignment three":
| Extra credit | 1 |
And I set the field "Grade report" to "User report"
@@ -204,9 +206,11 @@ Feature: We can understand the gradebook user report
| Test assignment six | 33.33 % | 30.00 | 0.00 |
@javascript
Scenario: Natural aggregation
Scenario: View user report with mixed aggregation methods
And I set the following settings for grade item "Course 1":
| Aggregation | Natural |
And I set the following settings for grade item "Sub category":
| Aggregation | Weighted mean of grades |
And I set the following settings for grade item "Test assignment three":
| Extra credit | 1 |
And I set the field "Grade report" to "User report"
@@ -221,3 +225,24 @@ Feature: We can understand the gradebook user report
| Test assignment four | 33.33 % | 10.00 | 3.33 |
| Test assignment five | 33.33 % | 70.00 | 23.33 |
| Test assignment six | 33.33 % | 30.00 | 10.00 |
| Category totalWeighted mean of grades. | 33.33 % | 36.67 | - |
| Course totalNatural. | - | 156.67 | - |
@javascript
Scenario: View user report with natural aggregation
And I set the following settings for grade item "Test assignment three":
| Extra credit | 1 |
And I set the field "Grade report" to "User report"
And I set the field "Select all or one user" to "Student 1"
# Check the values in the weights column.
Then the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Contribution to course total |
| Test assignment one | 20.00 % | 60.00 | 60.00 |
| Test assignment two | 20.00 % | 20.00 | 20.00 |
| Test assignment three | 20.00 %( Extra credit ) | 40.00 | 40.00 |
| Test assignment four | 33.33 % | 10.00 | 10.00 |
| Test assignment five | 33.33 % | 70.00 | 70.00 |
| Test assignment six | 33.33 % | 30.00 | 30.00 |
| Category totalNatural. | 60.00 % | 110.00 | - |
| Course totalNatural. | - | 230.00 | - |
+3 -3
View File
@@ -72,12 +72,12 @@ Feature: We can enter in grades and view reports from the gradebook
| Grade item | Grade | Range | Percentage |
| Test assignment name 1 | 80.00 | 0100 | 80.00 % |
| Test assignment name 2 | 90.00 | 0100 | 90.00 % |
| Course totalSimple weighted mean of grades. | 85.00 | 0100 | 85.00 % |
| Course totalNatural. | 170.00 | 0200 | 85.00 % |
And the following should not exist in the "user-grade" table:
| Grade item | Grade | Range | Percentage |
| Course total | 90.00 | 0110 | 90.00 % |
| Course totalNatural. | 90.00 | 0100 | 90.00 % |
And I set the field "Grade report" to "Overview report"
And "C1" row "Grade" column of "overview-grade" table should contain "85.00"
And "C1" row "Grade" column of "overview-grade" table should contain "170.00"
And "C1" row "Grade" column of "overview-grade" table should not contain "90.00"
@javascript