Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

Steps definitions for rubrics.

Copyright: 2013 David MonllaĆ³
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 506 lines (21 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 lib/behat/behat_base.php

Defines 1 class


Class: behat_gradingform_rubric  - X-Ref

Steps definitions to help with rubrics.

i_define_the_following_rubric(TableNode $rubric)   X-Ref
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.

param: TableNode $rubric

i_replace_rubric_level_with($currentvalue, $value, $criterionname)   X-Ref
Replaces a value from the specified criterion. You can use it when editing rubrics, to set both name or points.

param: string $currentvalue
param: string $value
param: string $criterionname

i_grade_by_filling_the_rubric_with(TableNode $rubric)   X-Ref
Grades filling the current page rubric. Set one line per criterion and for each criterion set "| Criterion name | Points | Remark |".

param: TableNode $rubric

the_level_with_points_was_previously_selected_for_the_rubric_criterion($points, $criterionname)   X-Ref
Checks that the level was previously selected and the user changed to another level.

param: string $criterionname
param: int $points
return: void

the_level_with_points_is_selected_for_the_rubric_criterion($points, $criterionname)   X-Ref
Checks that the level is currently selected. Works both when grading rubrics and viewing graded rubrics.

param: string $criterionname
param: int $points
return: void

the_level_with_points_is_not_selected_for_the_rubric_criterion($points, $criterionname)   X-Ref
Checks that the level is not currently selected. Works both when grading rubrics and viewing graded rubrics.

param: string $criterionname
param: int $points
return: void

set_rubric_field_value($name, $value, $visible = false)   X-Ref
Makes a hidden rubric field visible (if necessary) and sets a value on it.

param: string $name The name of the field
param: string $value The value to set
param: bool $visible
return: void

click_and_confirm($node)   X-Ref
Performs click confirming the action.

param: NodeElement $node
return: void

get_level_xpath($points)   X-Ref
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.

param: int $points
return: string

get_criterion_xpath($criterionname)   X-Ref
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.

param: string $criterionname Literal including the criterion name.
return: string