Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
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. More...
 
 gradebook_calculations_for_the_course_are_frozen_at_version ($coursename, $version)
 Step allowing to test before-the-fix behaviour of the gradebook. More...
 
 i_duplicate_the_grade_item ($gradeitem)
 Duplicates a grade item or category. More...
 
 i_give_the_feedback ($feedback, $userfullname, $itemname)
 Enters a quick feedback via the gradebook for a specific grade item and user when viewing the 'Grader report' with editing mode turned on. More...
 
 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. More...
 
 i_hide_the_grade_item ($gradeitem)
 Hids a grade item or category. More...
 
 i_navigate_to_in_the_course_gradebook ($gradepath)
 Navigates to the course gradebook and selects a specified item from the grade navigation tabs. More...
 
 i_reset_weights_for_grade_category ($gradeitem)
 Resets the weights for the grade category. More...
 
 i_set_calculation_for_grade_category_with_idnumbers ($calculation, $gradeitem, TableNode $data)
 Sets a calculated manual grade category total. More...
 
 i_set_calculation_for_grade_item_with_idnumbers ($calculation, $gradeitem, TableNode $data)
 Sets a calculated manual grade item. More...
 
 i_set_the_following_settings_for_grade_item ($gradeitem, TableNode $data)
 Changes the settings of a grade item or category or the course. More...
 

Public Attributes

const EXTENDED_TIMEOUT = 10
 And extended timeout for specific cases. More...
 
const PAGE_READY_JS
 The JS code to check that the page is ready. More...
 
const REDUCED_TIMEOUT = 2
 Small timeout. More...
 
const TIMEOUT = 6
 The timeout for each Behat step (load page, wait for an element to load...). More...
 

Protected Member Functions

 select_in_gradebook_tabs ($gradepath)
 Select the tab in the gradebook. More...
 

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_duplicate_the_grade_item()

behat_grade::i_duplicate_the_grade_item (   $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_feedback()

behat_grade::i_give_the_feedback (   $feedback,
  $userfullname,
  $itemname 
)

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

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

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

◆ 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 (   $gradeitem)

Hids a grade item or category.

Teacher must be on the grade setup page.

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

Parameters
string$gradeitem

◆ i_navigate_to_in_the_course_gradebook()

behat_grade::i_navigate_to_in_the_course_gradebook (   $gradepath)

Navigates to the course gradebook and selects a specified item from the grade navigation tabs.

Examples:

  • I navigate to "Setup > Gradebook setup" in the course gradebook
  • I navigate to "Scales" in the course gradebook
  • I navigate to "Letters > View" in the course gradebook
  • I navigate to "View > User report" in the course gradebook // for teachers
  • I navigate to "User report" in the course gradebook // for students

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

Parameters
string$gradepath

Reimplemented in behat_theme_classic_behat_grade.

◆ i_reset_weights_for_grade_category()

behat_grade::i_reset_weights_for_grade_category (   $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
$gradeitem

◆ i_set_calculation_for_grade_category_with_idnumbers()

behat_grade::i_set_calculation_for_grade_category_with_idnumbers (   $calculation,
  $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 (   $gradeitem,
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>(?:[^"]|::")*)":$/

Parameters
string$gradeitem
TableNode$data

◆ 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.

Parameters
string$gradepathexamples: "View > User report", "Letters > View", "Scales"

Member Data Documentation

◆ EXTENDED_TIMEOUT

const behat_session_interface::EXTENDED_TIMEOUT = 10
inherited

And extended timeout for specific cases.

Deprecated:
since Moodle 3.7 MDL-64979 - please use get_extended_timeout() instead
Todo:
MDL-64982 This will be deleted in Moodle 3.11
See also
behat_base::get_extended_timeout()

◆ 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.

◆ REDUCED_TIMEOUT

const behat_session_interface::REDUCED_TIMEOUT = 2
inherited

Small timeout.

A reduced timeout for cases where self::TIMEOUT is too much and a simple $this->getSession()->getPage()->find() could not be enough.

Deprecated:
since Moodle 3.7 MDL-64979 - please use get_reduced_timeout() instead
Todo:
MDL-64982 This will be deleted in Moodle 3.11
See also
behat_base::get_reduced_timeout()

◆ TIMEOUT

const behat_session_interface::TIMEOUT = 6
inherited

The timeout for each Behat step (load page, wait for an element to load...).

Deprecated:
since Moodle 3.7 MDL-64979 - please use get_timeout() instead
Todo:
MDL-64982 This will be deleted in Moodle 3.11
See also
behat_base::get_timeout()

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