Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
behat_grade Class Reference
Inheritance diagram for behat_grade:
behat_base behat_session_interface behat_theme_classic_behat_grade

Public Member Functions

 getSession ($name=null)
 Returns the Mink session.
 
 gradebook_calculations_for_the_course_are_frozen_at_version ($coursename, $version)
 Step allowing to test before-the-fix behaviour of the gradebook.
 
 i_click_on_in_search_widget (string $needle, string $haystack)
 Clicks on an option from the specified search widget in the current gradebook page.
 
 i_confirm_in_search_within_the_gradebook_widget_does_not_exist ($needle, $haystack)
 Confirm if a value is not within the search widget within the gradebook.
 
 i_confirm_in_search_within_the_gradebook_widget_exists ($needle, $haystack)
 Confirm if a value is within the search widget within the gradebook.
 
 i_duplicate_the_grade_item (string $gradeitem)
 Duplicates a grade item or category.
 
 i_give_the_grade ($grade, $userfullname, $itemname)
 Enters a grade via the gradebook for a specific grade item and user when viewing the 'Grader report' with editing mode turned on.
 
 i_hide_the_grade_item (string $gradeitem, string $type, string $page)
 Hids a grade item or category on gradebook setup or grader page.
 
 i_navigate_to_export_page_in_the_course_gradebook ($gradeexportoption)
 Navigates to the exports page in the course gradebook and selects the specified export type from the grade exports navigation selector.
 
 i_navigate_to_import_page_in_the_course_gradebook ($gradeimportoption)
 Navigates to the imports page in the course gradebook and selects the specified import type from the grade imports navigation selector.
 
 i_navigate_to_in_the_course_gradebook ($gradepath)
 Navigates to the course gradebook and selects the specified item from the general grade navigation selector.
 
 i_reset_weights_for_grade_category (string $gradeitem)
 Resets the weights for the grade category.
 
 i_set_calculation_for_grade_category_with_idnumbers (string $calculation, string $gradeitem, TableNode $data)
 Sets a calculated manual grade category total.
 
 i_set_calculation_for_grade_item_with_idnumbers ($calculation, $gradeitem, TableNode $data)
 Sets a calculated manual grade item.
 
 i_set_the_following_settings_for_grade_item (string $gradeitem, string $type, string $page, TableNode $data)
 Changes the settings of a grade item or category or the course.
 

Public Attributes

const PAGE_READY_JS
 The JS code to check that the page is ready.
 

Protected Member Functions

 select_in_gradebook_navigation_selector (string $path, string $formid)
 Select a given option from a navigation URL selector in the gradebook.
 
 select_in_gradebook_tabs ($gradepath)
 Select the tab in the gradebook.
 

Detailed Description

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ getSession()

behat_session_interface::getSession ( $name = null)
inherited

Returns the Mink session.

Parameters
string | null$namename of the session OR active session will be used
Return values
Behat\Mink\Session

Implemented in behat_form_field.

◆ gradebook_calculations_for_the_course_are_frozen_at_version()

behat_grade::gradebook_calculations_for_the_course_are_frozen_at_version ( $coursename,
$version )

Step allowing to test before-the-fix behaviour of the gradebook.

@Given /^gradebook calculations for the course "(?P<coursename_string>(?:[^"]|::")*)" are frozen at version "(?P<version_string>(?:[^"]|")*)"$/

Parameters
string$coursename
string$version

◆ i_click_on_in_search_widget()

behat_grade::i_click_on_in_search_widget ( string $needle,
string $haystack )

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

@Given /^I click on "(?P<needle>(?:[^"]|::")*)" in the "(?P<haystack>(?:[^"]|")*)" search widget$/

Parameters
string$needleThe value to search for.
string$haystackThe type of the search widget.

◆ i_confirm_in_search_within_the_gradebook_widget_does_not_exist()

behat_grade::i_confirm_in_search_within_the_gradebook_widget_does_not_exist ( $needle,
$haystack )

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

@Given /^I confirm "(?P<needle>(?:[^"]|::")*)" in "(?P<haystack>(?:[^"]|")*)" search within the gradebook widget does not exist$/

Parameters
string$needleThe value to search for.
string$haystackThe type of the search widget.

◆ i_confirm_in_search_within_the_gradebook_widget_exists()

behat_grade::i_confirm_in_search_within_the_gradebook_widget_exists ( $needle,
$haystack )

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

@Given /^I confirm "(?P<needle>(?:[^"]|::")*)" in "(?P<haystack>(?:[^"]|")*)" search within the gradebook widget exists$/

Parameters
string$needleThe value to search for.
string$haystackThe type of the search widget.

◆ i_duplicate_the_grade_item()

behat_grade::i_duplicate_the_grade_item ( string $gradeitem)

Duplicates a grade item or category.

Teacher must be on the grade setup page.

@Given /^I duplicate the grade item "(?P<grade_item_string>(?:[^"]|::")*)"$/

Parameters
string$gradeitem

◆ i_give_the_grade()

behat_grade::i_give_the_grade ( $grade,
$userfullname,
$itemname )

Enters a grade via the gradebook for a specific grade item and user when viewing the 'Grader report' with editing mode turned on.

@Given /^I give the grade "(?P<grade_number>(?:[^"]|::")*)" to the user "(?P<username_string>(?:[^"]|")*)" for the grade item "(?P<grade_activity_string>(?:[^"]|::")*)"$/

Parameters
int$grade
string$userfullnamethe user's fullname as returned by fullname()
string$itemname

◆ i_hide_the_grade_item()

behat_grade::i_hide_the_grade_item ( string $gradeitem,
string $type,
string $page )

Hids a grade item or category on gradebook setup or grader page.

Teacher must be on the grade setup page.

@Given /^I hide the grade item "(?P<grade_item_string>(?:[^"]|::")*)" of type "([^"]*)" on "([^"]*)" page$/

Parameters
string$gradeitem
string$type
string$page

◆ i_navigate_to_export_page_in_the_course_gradebook()

behat_grade::i_navigate_to_export_page_in_the_course_gradebook ( $gradeexportoption)

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

@Given /^I navigate to "(?P<exportoption_string>(?:[^"]|::")*)" export page in the course gradebook$/

Parameters
string$gradeexportoptionThe name of an existing grade export option.

◆ i_navigate_to_import_page_in_the_course_gradebook()

behat_grade::i_navigate_to_import_page_in_the_course_gradebook ( $gradeimportoption)

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

@Given /^I navigate to "(?P<importoption_string>(?:[^"]|::")*)" import page in the course gradebook$/

Parameters
string$gradeimportoptionThe name of an existing grade import option.

◆ i_navigate_to_in_the_course_gradebook()

behat_grade::i_navigate_to_in_the_course_gradebook ( $gradepath)

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

@Given /^I navigate to "(?P<gradepath_string>(?:[^"]|::")*)" in the course gradebook$/

Parameters
string$gradepathThe path string. If the path has two items (ex. "More > Grade letters"), the first item ("More") will be used to identify an option group in the navigation selector, while the second ("Grade letters") will be used to identify an option within that option group. Otherwise, a single item in a path (ex. "Scales") will be used to identify an option in the navigation selector regardless of the option group.

Reimplemented in behat_theme_classic_behat_grade.

◆ i_reset_weights_for_grade_category()

behat_grade::i_reset_weights_for_grade_category ( string $gradeitem)

Resets the weights for the grade category.

Teacher must be on the grade setup page.

@Given /^I reset weights for grade category "(?P<grade_item_string>(?:[^"]|::")*)"$/

Parameters
string$gradeitem

◆ i_set_calculation_for_grade_category_with_idnumbers()

behat_grade::i_set_calculation_for_grade_category_with_idnumbers ( string $calculation,
string $gradeitem,
TableNode $data )

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.

@Given /^I set "(?P<calculation_string>(?:[^"]|::")*)" calculation for grade category "(?P<grade_item_string>(?:[^"]|")*)" with idnumbers:$/

Parameters
string$calculationThe calculation.
string$gradeitemThe grade item name.
TableNode$dataThe grade item name - idnumbers relation.

◆ i_set_calculation_for_grade_item_with_idnumbers()

behat_grade::i_set_calculation_for_grade_item_with_idnumbers ( $calculation,
$gradeitem,
TableNode $data )

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:$/

Parameters
string$calculationThe calculation.
string$gradeitemThe grade item name.
TableNode$TableNodeThe grade item name - idnumbers relation.

◆ i_set_the_following_settings_for_grade_item()

behat_grade::i_set_the_following_settings_for_grade_item ( string $gradeitem,
string $type,
string $page,
TableNode $data )

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.

@Given /^I set the following settings for grade item "(?P<grade_item_string>(?:[^"]|::")*)" of type "([^"]*)" on "([^"]*)" page:$/

Parameters
string$gradeitem
string$type
string$page
TableNode$data

◆ select_in_gradebook_navigation_selector()

behat_grade::select_in_gradebook_navigation_selector ( string $path,
string $formid )
protected

Select a given option from a navigation URL selector in the gradebook.

We must be on one of the gradebook pages already.

Deprecated
since 4.1 - use behat_forms\i_set_the_field_to() instead.
Parameters
string$pathThe string path that is used to identify an item within the navigation selector. If the path has two items (ex. "More > Grade letters"), the first item ("More") will be used to identify an option group in the navigation selector, while the second ("Grade letters") will be used to identify an option within that option group. Otherwise, a single item in a path (ex. "Scales") will be used to identify an option in the navigation selector regardless of the option group.
string$formidThe ID of the form element which contains the navigation URL selector element.

◆ select_in_gradebook_tabs()

behat_grade::select_in_gradebook_tabs ( $gradepath)
protected

Select the tab in the gradebook.

We must be on one of the gradebook pages already.

Deprecated
since 4.0 - use behat_forms\i_set_the_field_to() instead.
Parameters
string$gradepathexamples: "View > User report", "Letters > View", "Scales"

Member Data Documentation

◆ PAGE_READY_JS

const behat_session_interface::PAGE_READY_JS
inherited
Initial value:
= "document.readyState === 'complete' && " .
"(typeof M !== 'object' || typeof M.util !== 'object' || " .
"typeof M.util.pending_js === 'undefined' || M.util.pending_js.length === 0)"

The JS code to check that the page is ready.

The document must be complete and either M.util.pending_js must be empty, or it must not be defined at all.


The documentation for this class was generated from the following file: