Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Class: behat_grade  - X-Ref

i_give_the_grade($grade, $userfullname, $itemname)   X-Ref
Enters a grade via the gradebook for a specific grade item and user when viewing the 'Grader report' with editing mode turned on.

param: int $grade
param: string $userfullname the user's fullname as returned by fullname()
param: string $itemname

i_give_the_feedback($feedback, $userfullname, $itemname)   X-Ref
Enters a quick feedback via the gradebook for a specific grade item and user when viewing
the 'Grader report' with editing mode turned on.

param: string $feedback
param: string $userfullname the user's fullname as returned by fullname()
param: string $itemname

i_set_the_following_settings_for_grade_item($gradeitem, TableNode $data)   X-Ref
Changes the settings of a grade item or category or the course.

Teacher must be either on the grade setup page or on the Grader report page with editing mode turned on.

param: string $gradeitem
param: TableNode $data

i_hide_the_grade_item($gradeitem)   X-Ref
Hids a grade item or category.

Teacher must be on the grade setup page.

param: string $gradeitem

i_duplicate_the_grade_item($gradeitem)   X-Ref
Duplicates a grade item or category.

Teacher must be on the grade setup page.

param: string $gradeitem

i_set_calculation_for_grade_item_with_idnumbers($calculation, $gradeitem, TableNode $data)   X-Ref
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.

param: string $calculation The calculation.
param: string $gradeitem The grade item name.
param: TableNode $TableNode The grade item name - idnumbers relation.

i_set_calculation_for_grade_category_with_idnumbers($calculation, $gradeitem, TableNode $data)   X-Ref
Sets a calculated manual grade category total. Needs a table with item name - idnumber relation.
The step requires you to be in the 'Gradebook setup' page.

param: string $calculation The calculation.
param: string $gradeitem The grade item name.
param: TableNode $data The grade item name - idnumbers relation.

i_reset_weights_for_grade_category($gradeitem)   X-Ref
Resets the weights for the grade category

Teacher must be on the grade setup page.

param: $gradeitem

gradebook_calculations_for_the_course_are_frozen_at_version($coursename, $version)   X-Ref
Step allowing to test before-the-fix behaviour of the gradebook

param: string $coursename
param: string $version

select_in_gradebook_tabs($gradepath)   X-Ref
Select the tab in the gradebook. We must be on one of the gradebook pages already.

param: string $gradepath examples: "View > User report", "Letters > View", "Scales"

i_navigate_to_in_the_course_gradebook($gradepath)   X-Ref
Navigates to the course gradebook and selects the specified item from the general grade navigation selector.

Examples:
- I navigate to "Setup > Gradebook setup" in the course gradebook
- I navigate to "Scales" in the course gradebook
- I navigate to "More > Grade letters" in the course gradebook

param: string $gradepath The path string. If the path has two items (ex. "More > Grade letters"), the first item

i_navigate_to_import_page_in_the_course_gradebook($gradeimportoption)   X-Ref
Navigates to the imports page in the course gradebook and selects the specified import type from the grade
imports navigation selector.

Examples:
- I navigate to "CSV file" import page in the course gradebook

param: string $gradeimportoption The name of an existing grade import option.

i_navigate_to_export_page_in_the_course_gradebook($gradeexportoption)   X-Ref
Navigates to the exports page in the course gradebook and selects the specified export type from the grade
exports navigation selector.

Examples:
- I navigate to "XML file" export page in the course gradebook

param: string $gradeexportoption The name of an existing grade export option.

select_in_gradebook_navigation_selector(string $path, string $formid)   X-Ref
Select a given option from a navigation URL selector in the gradebook. We must be on one of the gradebook pages
already.

param: string $path The string path that is used to identify an item within the navigation selector. If the path
param: string $formid The ID of the form element which contains the navigation URL selector element.

i_confirm_in_search_within_the_gradebook_widget_exists($needle, $haystack)   X-Ref
Confirm if a value is within the search widget within the gradebook.

Examples:
- I confirm "User" in "user" search within the gradebook widget exists
- I confirm "Group" in "group" search within the gradebook widget exists
- I confirm "Grade item" in "grade" search within the gradebook widget exists

param: string $needle The value to search for.
param: string $haystack The type of the search widget.

i_confirm_in_search_within_the_gradebook_widget_does_not_exist($needle, $haystack)   X-Ref
Confirm if a value is not within the search widget within the gradebook.

Examples:
- I confirm "User" in "user" search within the gradebook widget does not exist
- I confirm "Group" in "group" search within the gradebook widget does not exist
- I confirm "Grade item" in "grade" search within the gradebook widget does not exist

param: string $needle The value to search for.
param: string $haystack The type of the search widget.

i_click_on_in_search_widget(string $needle, string $haystack)   X-Ref
Clicks on an option from the specified search widget in the current gradebook page.

Examples:
- I click on "Student" in the "user" search widget
- I click on "Group" in the "group" search widget
- I click on "Grade item" in the "grade" search widget

param: string $needle The value to search for.
param: string $haystack The type of the search widget.