diff --git a/admin/settings/grades.php b/admin/settings/grades.php index d47936130a8..84a5296dfde 100644 --- a/admin/settings/grades.php +++ b/admin/settings/grades.php @@ -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'), diff --git a/grade/tests/behat/grade_calculated_weights.feature b/grade/tests/behat/grade_calculated_weights.feature index 6392a7188ed..ccab3c0e780 100644 --- a/grade/tests/behat/grade_calculated_weights.feature +++ b/grade/tests/behat/grade_calculated_weights.feature @@ -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 | - | diff --git a/grade/tests/behat/grade_view.feature b/grade/tests/behat/grade_view.feature index 7b52c977a52..cece51a1aac 100644 --- a/grade/tests/behat/grade_view.feature +++ b/grade/tests/behat/grade_view.feature @@ -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 | 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