Skip to content

Commit

Permalink
MDL-51051 core_grades: 'Categories and items' => 'Gradebook setup'
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson authored and andrewnicols committed Sep 14, 2015
1 parent f495510 commit 53914e4
Show file tree
Hide file tree
Showing 30 changed files with 71 additions and 65 deletions.
4 changes: 2 additions & 2 deletions admin/tool/behat/tests/behat/data_generators.feature
Expand Up @@ -351,7 +351,7 @@ Feature: Set up contextual data for tests
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I expand "Setup" node
And I follow "Categories and items"
And I follow "Gradebook setup"
Then I should see "Test Grade Item 1"
And I follow "Edit Test Grade Item 1"
And I expand all fieldsets
Expand Down Expand Up @@ -434,7 +434,7 @@ Feature: Set up contextual data for tests
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I expand "Setup" node
And I follow "Categories and items"
And I follow "Gradebook setup"
Then I should see "Test Outcome Grade Item 1"
And I follow "Edit Test Outcome Grade Item 1"
And the field "Outcome" matches value "Grade outcome 1"
Expand Down
4 changes: 2 additions & 2 deletions grade/edit/tree/index.php
Expand Up @@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Edit and review page for grade categories and items
* The Gradebook setup page.
*
* @package core_grades
* @copyright 2008 Nicolas Connault
Expand Down Expand Up @@ -244,7 +244,7 @@
}
}

print_grade_page_head($courseid, 'settings', 'setup', get_string('categoriesanditems', 'grades'));
print_grade_page_head($courseid, 'settings', 'setup', get_string('gradebooksetup', 'grades'));

// Print Table of categories and items
echo $OUTPUT->box_start('gradetreebox generalbox');
Expand Down
6 changes: 3 additions & 3 deletions grade/edit/tree/lib.php
Expand Up @@ -435,9 +435,9 @@ static function get_weight_input($item) {
return $str;
}

//Trims trailing zeros
//Used on the 'categories and items' page for grade items settings like aggregation co-efficient
//Grader report has its own decimal place settings so they are handled elsewhere
// Trims trailing zeros.
// Used on the 'Gradebook setup' page for grade items settings like aggregation co-efficient.
// Grader report has its own decimal place settings so they are handled elsewhere.
static function format_number($number) {
$formatted = rtrim(format_float($number, 4),'0');
if (substr($formatted, -1)==get_string('decsep', 'langconfig')) { //if last char is the decimal point
Expand Down
4 changes: 2 additions & 2 deletions grade/lib.php
Expand Up @@ -2832,9 +2832,9 @@ public static function get_info_manage_settings($courseid) {
$context = context_course::instance($courseid);
self::$managesetting = array();
if ($courseid != SITEID && has_capability('moodle/grade:manage', $context)) {
self::$managesetting['categoriesanditems'] = new grade_plugin_info('setup',
self::$managesetting['gradebooksetup'] = new grade_plugin_info('setup',
new moodle_url('/grade/edit/tree/index.php', array('id' => $courseid)),
get_string('categoriesanditems', 'grades'));
get_string('gradebooksetup', 'grades'));
self::$managesetting['coursesettings'] = new grade_plugin_info('coursesettings',
new moodle_url('/grade/edit/settings/index.php', array('id'=>$courseid)),
get_string('coursegradesettings', 'grades'));
Expand Down
5 changes: 3 additions & 2 deletions grade/tests/behat/behat_grade.php
Expand Up @@ -80,7 +80,8 @@ public function i_set_the_following_settings_for_grade_item($gradeitem, TableNod
}

/**
* Sets a calculated manual grade item. Needs a table with item name - idnumber relation. The step requires you to be in categories and items page.
* Sets a calculated manual grade item. Needs a table with item name - idnumber relation.
* The step requires you to be in the 'Gradebook setup' page.
*
* @Given /^I set "(?P<calculation_string>(?:[^"]|\\")*)" calculation for grade item "(?P<grade_item_string>(?:[^"]|\\")*)" with idnumbers:$/
* @param string $calculation The calculation.
Expand Down Expand Up @@ -139,7 +140,7 @@ public function i_set_calculation_for_grade_item_with_idnumbers($calculation, $g

/**
* Sets a calculated manual grade category total. Needs a table with item name - idnumber relation.
* The step requires you to be in categories and items page.
* The step requires you to be in the 'Gradebook setup' page.
*
* @Given /^I set "(?P<calculation_string>(?:[^"]|\\")*)" calculation for grade category "(?P<grade_item_string>(?:[^"]|\\")*)" with idnumbers:$/
* @param string $calculation The calculation.
Expand Down
16 changes: 8 additions & 8 deletions grade/tests/behat/grade_aggregation.feature
Expand Up @@ -235,7 +235,7 @@ Feature: We can use calculated grade totals
| itemname | course | outcome | gradetype | scale |
| Test outcome item one | C1 | OT1 | Scale | Test Scale |
And I expand "Setup" node
And I follow "Categories and items"
And I follow "Gradebook setup"
And I set the following settings for grade item "Course 1":
| Aggregation | Natural |
| Include outcomes in aggregation | 1 |
Expand All @@ -258,7 +258,7 @@ Feature: We can use calculated grade totals
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I expand "Setup" node
And I follow "Categories and items"
And I follow "Gradebook setup"
And I set the following settings for grade item "Test outcome item one":
| Extra credit | 1 |
And I log out
Expand All @@ -272,7 +272,7 @@ Feature: We can use calculated grade totals
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I expand "Setup" node
And I follow "Categories and items"
And I follow "Gradebook setup"
And I set the following settings for grade item "Course 1":
| Aggregation | Natural |
| Include outcomes in aggregation | 0 |
Expand All @@ -297,7 +297,7 @@ Feature: We can use calculated grade totals
| Test outcome item one | C1 | OT1 | Scale | Test Scale |
And I navigate to "Grades" node in "Course administration"
And I expand "Setup" node
And I follow "Categories and items"
And I follow "Gradebook setup"
And I set the following settings for grade item "Course 1":
| Aggregation | Natural |
| Include outcomes in aggregation | 1 |
Expand Down Expand Up @@ -387,7 +387,7 @@ Feature: We can use calculated grade totals
And I set the following settings for grade item "Course 1":
| Aggregation | Natural |
| Exclude empty grades | 0 |
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I press "Add category"
And I set the following fields to these values:
| Category name | Sub category 3 |
Expand Down Expand Up @@ -441,7 +441,7 @@ Feature: We can use calculated grade totals
And I press "Save changes"
And I turn editing mode off
And I should see "250.00 (25.25 %)" in the ".course" "css_element"
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I press "Add category"
And I set the following fields to these values:
| Category name | Sub sub category 1 |
Expand All @@ -452,7 +452,7 @@ Feature: We can use calculated grade totals

@javascript
Scenario: Natural aggregation from the setup screen
And I select "Categories and items" from the "Grade report" singleselect
And I select "Gradebook setup" from the "Grade report" singleselect
And I set the following settings for grade item "Course 1":
| Aggregation | Natural |
And I set the following settings for grade item "Sub category 1":
Expand Down Expand Up @@ -514,7 +514,7 @@ Feature: We can use calculated grade totals
| Aggregation | Natural |
| Exclude empty grades | 0 |
And I turn editing mode off
And I select "Categories and items" from the "Grade report" singleselect
And I select "Gradebook setup" from the "Grade report" singleselect
And I set the field "Override weight of Test assignment one" to "1"
And I set the field "Weight of Test assignment one" to "0"
And I set the field "Override weight of Test assignment six" to "1"
Expand Down
12 changes: 6 additions & 6 deletions grade/tests/behat/grade_aggregation_changes.feature
Expand Up @@ -336,7 +336,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit
@javascript
Scenario: Switching grade items between categories
# Move to same aggregation (Natural).
Given I navigate to "Categories and items" node in "Grade administration > Setup"
Given I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the field "Select Item a1" to "1"
And I set the field "Select Item a2" to "1"
And I set the field "Select Item a3" to "1"
Expand All @@ -362,7 +362,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit
And the field "Extra credit" matches value "1"
And I press "Cancel"
# Move to Mean of grades (with extra credit).
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the field "Select Item a1" to "1"
And I set the field "Select Item a2" to "1"
And I set the field "Select Item a3" to "1"
Expand All @@ -382,7 +382,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit
And the field "Extra credit" matches value "1"
And I press "Cancel"
# Move to Simple weight mean of grades.
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the field "Select Item a1" to "1"
And I set the field "Select Item a2" to "1"
And I set the field "Select Item a3" to "1"
Expand All @@ -402,7 +402,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit
And the field "Extra credit" matches value "1"
And I press "Cancel"
# Move to Weighted mean of grades.
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the field "Select Item a1" to "1"
And I set the field "Select Item a2" to "1"
And I set the field "Select Item a3" to "1"
Expand All @@ -426,7 +426,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit
And I set the field "Item weight" to "11"
And I press "Save changes"
# Move to same (Weighted mean of grades).
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the field "Select Item a1" to "1"
And I set the field "Select Item a2" to "1"
And I set the field "Select Item a3" to "1"
Expand All @@ -447,7 +447,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit
And the field "Item weight" matches value "11"
And I press "Save changes"
# Move back to Natural.
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the field "Select Item a1" to "1"
And I set the field "Select Item a2" to "1"
And I set the field "Select Item a3" to "1"
Expand Down
2 changes: 1 addition & 1 deletion grade/tests/behat/grade_average.feature
Expand Up @@ -30,7 +30,7 @@ Feature: Average grades are displayed in the gradebook
| Show average | Show |
And I press "Save changes"
# Add a manual grade item
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I press "Add grade item"
And I set the following fields to these values:
| Item name | Manual item 1 |
Expand Down
8 changes: 4 additions & 4 deletions grade/tests/behat/grade_calculated_grade_items.feature
Expand Up @@ -2,7 +2,7 @@
Feature: Calculated grade items can be used in the gradebook
In order to use calculated grade items in the gradebook
As a teacher
I need setup calculated grade items in the categories and items page.
I need setup calculated grade items in the 'Gradebook setup' page.

Background:
Given the following "courses" exist:
Expand All @@ -22,7 +22,7 @@ Feature: Calculated grade items can be used in the gradebook
And I am on site homepage
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"

@javascript
Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed
Expand Down Expand Up @@ -77,7 +77,7 @@ Feature: Calculated grade items can be used in the gradebook
| grade item 1 | - | 75.00 | 0100 | 75.00 % | - |
| Calc cat totalInclude empty grades. | 100.00 % | 37.50 | 050 | 75.00 % | - |
| Course total | - | 37.50 | 050 | 75.00 % | - |
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the following settings for grade item "Calc cat":
| Maximum grade | 40 |
And I follow "Grader report"
Expand Down Expand Up @@ -143,7 +143,7 @@ Feature: Calculated grade items can be used in the gradebook
| grade item 1 | 66.67 % | 75.00 | 0100 | 75.00 % | 50.00 % |
| calc item | 33.33 % | 37.50 | 050 | 75.00 % | 25.00 % |
| Course total | - | 112.50 | 0150 | 75.00 % | - |
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the following settings for grade item "calc item":
| Maximum grade | 40 |
And I follow "Grader report"
Expand Down
Expand Up @@ -23,7 +23,7 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506
And I am on site homepage
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"

@javascript
Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed
Expand Down Expand Up @@ -78,7 +78,7 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506
| grade item 1 | - | 75.00 | 0100 | 75.00 % | - |
| Calc cat totalInclude empty grades. | 100.00 % | 37.50 | 0100 | 37.50 % | - |
| Course total | - | 37.50 | 0100 | 37.50 % | - |
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the following settings for grade item "Calc cat":
| Maximum grade | 40 |
And I follow "Grader report"
Expand Down Expand Up @@ -144,7 +144,7 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506
| grade item 1 | 50.00 % | 75.00 | 0100 | 75.00 % | 37.50 % |
| calc item | 50.00 % | 37.50 | 0100 | 37.50 % | 18.75 % |
| Course total | - | 112.50 | 0200 | 56.25 % | - |
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the following settings for grade item "calc item":
| Maximum grade | 40 |
And I follow "Grader report"
Expand Down
2 changes: 1 addition & 1 deletion grade/tests/behat/grade_calculated_weights.feature
Expand Up @@ -43,7 +43,7 @@ Feature: We can understand the gradebook user report
And I set the field "Show weightings" to "Show"
And I set the field "Show contribution to course total" to "Show"
And I press "Save changes"
And I set the field "Grade report" to "Categories and items"
And I set the field "Grade report" to "Gradebook setup"
And I press "Add category"
And I set the field "Category name" to "Sub category"
And I press "Save changes"
Expand Down
Expand Up @@ -22,7 +22,7 @@ Feature: Extra credit contributions are normalised when going out of bounds
And I am on site homepage
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I press "Add grade item"
And I set the following fields to these values:
| Item name | Manual item 1 |
Expand Down Expand Up @@ -56,7 +56,7 @@ Feature: Extra credit contributions are normalised when going out of bounds
And I press "Save changes"

Scenario Outline: The contribution of extra credit items is normalised
Given I set the field "Grade report" to "Categories and items"
Given I set the field "Grade report" to "Gradebook setup"
When I set the following settings for grade item "Course 1":
| Aggregation | <aggregation> |
And I set the following settings for grade item "Manual item 2":
Expand Down
4 changes: 2 additions & 2 deletions grade/tests/behat/grade_mingrade.feature
Expand Up @@ -28,7 +28,7 @@ Feature: We can use a minimum grade different than zero
And I am on site homepage
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I press "Add grade item"
And I set the following fields to these values:
| Item name | Manual item 1 |
Expand Down Expand Up @@ -73,7 +73,7 @@ Feature: We can use a minimum grade different than zero

@javascript
Scenario: Natural aggregation with negative and positive grade
And I navigate to "Categories and items" node in "Grade administration > Setup"
And I navigate to "Gradebook setup" node in "Grade administration > Setup"
And I set the following settings for grade item "Sub category 1":
| Aggregation | Natural |
| Exclude empty grades | 0 |
Expand Down

0 comments on commit 53914e4

Please sign in to comment.