Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
behat_gradingform_rubric Class Reference

Steps definitions to help with rubrics. More...

Inheritance diagram for behat_gradingform_rubric:
behat_base behat_session_interface

Public Member Functions

 getSession ($name=null)
 Returns the Mink session.
 
 i_define_the_following_rubric (TableNode $rubric)
 Defines the rubric with the provided data, following rubric's definition grid cells.
 
 i_grade_by_filling_the_rubric_with (TableNode $rubric)
 Grades filling the current page rubric.
 
 i_replace_rubric_level_with ($currentvalue, $value, $criterionname)
 Replaces a value from the specified criterion.
 
 the_level_with_points_is_not_selected_for_the_rubric_criterion ($points, $criterionname)
 Checks that the level is not currently selected.
 
 the_level_with_points_is_selected_for_the_rubric_criterion ($points, $criterionname)
 Checks that the level is currently selected.
 
 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.
 

Public Attributes

The const DEFAULT_RUBRIC_LEVELS = 3
 number of levels added by default when a rubric is created.
 
const PAGE_READY_JS
 The JS code to check that the page is ready.
 

Protected Member Functions

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

Detailed Description

Steps definitions to help with rubrics.

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

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

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