Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
behat_gradingform_rubric Class Reference
Inheritance diagram for behat_gradingform_rubric:
behat_base behat_session_interface

Public Member Functions

 getSession ($name=null)
 Returns the Mink session. More...
 
 i_define_the_following_rubric (TableNode $rubric)
 Defines the rubric with the provided data, following rubric's definition grid cells. More...
 
 i_grade_by_filling_the_rubric_with (TableNode $rubric)
 Grades filling the current page rubric. More...
 
 i_replace_rubric_level_with ($currentvalue, $value, $criterionname)
 Replaces a value from the specified criterion. More...
 
 the_level_with_points_is_not_selected_for_the_rubric_criterion ($points, $criterionname)
 Checks that the level is not currently selected. More...
 
 the_level_with_points_is_selected_for_the_rubric_criterion ($points, $criterionname)
 Checks that the level is currently selected. More...
 
 the_level_with_points_was_previously_selected_for_the_rubric_criterion ($points, $criterionname)
 Checks that the level was previously selected and the user changed to another level. More...
 

Public Attributes

The const DEFAULT_RUBRIC_LEVELS = 3
 number of levels added by default when a rubric is created.
 
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

 click_and_confirm ($node)
 Performs click confirming the action. More...
 
 get_criterion_xpath ($criterionname)
 Returns the xpath representing the selected criterion. More...
 
 get_level_xpath ($points)
 Returns the xpath representing a selected level. More...
 
 set_rubric_field_value ($name, $value, $visible=false)
 Makes a hidden rubric field visible (if necessary) and sets a value on it. More...
 

Member Function Documentation

◆ click_and_confirm()

behat_gradingform_rubric::click_and_confirm (   $node)
protected

Performs click confirming the action.

Parameters
NodeElement$node
Return values
void

◆ get_criterion_xpath()

behat_gradingform_rubric::get_criterion_xpath (   $criterionname)
protected

Returns the xpath representing the selected criterion.

It is the xpath when grading a rubric or viewing a rubric, it is not the same xpath when editing a rubric.

Parameters
string$criterionnameLiteral including the criterion name.
Return values
string

◆ get_level_xpath()

behat_gradingform_rubric::get_level_xpath (   $points)
protected

Returns the xpath representing a selected level.

It is not including the path to the criterion.

It is the xpath when grading a rubric or viewing a rubric, it is not the same xpath when editing a rubric.

Parameters
int$points
Return values
string

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

◆ i_define_the_following_rubric()

behat_gradingform_rubric::i_define_the_following_rubric ( TableNode  $rubric)

Defines the rubric with the provided data, following rubric's definition grid cells.

This method fills the rubric of the rubric definition form; the provided TableNode should contain one row for each criterion and each cell of the row should contain:

Criterion description

Criterion level 1 name

Criterion level 1 points

Criterion level 2 name

Criterion level 2 points

Criterion level 3 .....

Works with both JS and non-JS.

@When /^I define the following rubric:$/

Exceptions
ExpectationException
Parameters
TableNode$rubric

◆ i_grade_by_filling_the_rubric_with()

behat_gradingform_rubric::i_grade_by_filling_the_rubric_with ( TableNode  $rubric)

Grades filling the current page rubric.

Set one line per criterion and for each criterion set "| Criterion name | Points | Remark |".

@When /^I grade by filling the rubric with:$/

Exceptions
ExpectationException
Parameters
TableNode$rubric

◆ i_replace_rubric_level_with()

behat_gradingform_rubric::i_replace_rubric_level_with (   $currentvalue,
  $value,
  $criterionname 
)

Replaces a value from the specified criterion.

You can use it when editing rubrics, to set both name or points.

@When /^I replace "(?P<current_value_string>(?:[^"]|::")*)" rubric level with "(?P<value_string>(?:[^"]|")*)" in "(?P<criterion_string>(?:[^"]|::")*)" criterion$/

Exceptions
ElementNotFoundException
Parameters
string$currentvalue
string$value
string$criterionname

◆ set_rubric_field_value()

behat_gradingform_rubric::set_rubric_field_value (   $name,
  $value,
  $visible = false 
)
protected

Makes a hidden rubric field visible (if necessary) and sets a value on it.

Parameters
string$nameThe name of the field
string$valueThe value to set
bool$visible
Return values
void

◆ the_level_with_points_is_not_selected_for_the_rubric_criterion()

behat_gradingform_rubric::the_level_with_points_is_not_selected_for_the_rubric_criterion (   $points,
  $criterionname 
)

Checks that the level is not currently selected.

Works both when grading rubrics and viewing graded rubrics.

@Then /^the level with "(?P<points_number>::d+)" points is not selected for the rubric criterion "(?P<criterion_name_string>(?:[^"]|")*)"$/

Exceptions
ExpectationException
Parameters
string$criterionname
int$points
Return values
void

◆ the_level_with_points_is_selected_for_the_rubric_criterion()

behat_gradingform_rubric::the_level_with_points_is_selected_for_the_rubric_criterion (   $points,
  $criterionname 
)

Checks that the level is currently selected.

Works both when grading rubrics and viewing graded rubrics.

@Then /^the level with "(?P<points_number>::d+)" points is selected for the rubric criterion "(?P<criterion_name_string>(?:[^"]|")*)"$/

Exceptions
ExpectationException
Parameters
string$criterionname
int$points
Return values
void

◆ the_level_with_points_was_previously_selected_for_the_rubric_criterion()

behat_gradingform_rubric::the_level_with_points_was_previously_selected_for_the_rubric_criterion (   $points,
  $criterionname 
)

Checks that the level was previously selected and the user changed to another level.

@Then /^the level with "(?P<points_number>::d+)" points was previously selected for the rubric criterion "(?P<criterion_name_string>(?:[^"]|")*)"$/

Exceptions
ExpectationException
Parameters
string$criterionname
int$points
Return values
void

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: