$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'),
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"
| 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"
| 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 | - |
| Grade item | Grade | Range | Percentage |
| Test assignment name 1 | 80.00 | 0–100 | 80.00 % |
| Test assignment name 2 | 90.00 | 0–100 | 90.00 % |
- | Course totalSimple weighted mean of grades. | 85.00 | 0–100 | 85.00 % |
+ | Course totalNatural. | 170.00 | 0–200 | 85.00 % |
And the following should not exist in the "user-grade" table:
| Grade item | Grade | Range | Percentage |
- | Course total | 90.00 | 0–110 | 90.00 % |
+ | Course totalNatural. | 90.00 | 0–100 | 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