Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
behat_qtype_ordering Class Reference
Inheritance diagram for behat_qtype_ordering:
behat_base behat_session_interface

Public Member Functions

 getSession ($name=null)
 Returns the Mink session.
 
 i_drag_to_space_in_the_drag_and_drop_into_text_question (string $label, int $position)
 Drag the drag item with the given text to the given space.
 

Public Attributes

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

Protected Member Functions

 item_xpath_by_label (string $label)
 Get the xpath for a given item by label.
 
 item_xpath_by_position (string $position)
 Get the xpath for a given drop box.
 

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.

◆ i_drag_to_space_in_the_drag_and_drop_into_text_question()

behat_qtype_ordering::i_drag_to_space_in_the_drag_and_drop_into_text_question ( string $label,
int $position )

Drag the drag item with the given text to the given space.

Warning, only works if the question is using a behaviour like Immediate feedback that has a check button.

Also, do not use this to drag an item to the last place. Just drag all the other non-last items to their place.

Parameters
string$labelthe text of the item to drag.
int$positionthe number of the position to drop it at.

@Given /^I drag "(?P<label>[^"]*)" to space "(?P<position>\d+)" in the ordering question$/

◆ item_xpath_by_label()

behat_qtype_ordering::item_xpath_by_label ( string $label)
protected

Get the xpath for a given item by label.

Parameters
string$labelthe text of the item to drag.
Return values
stringthe xpath expression.

◆ item_xpath_by_position()

behat_qtype_ordering::item_xpath_by_position ( string $position)
protected

Get the xpath for a given drop box.

Parameters
string$positionthe number of place to drop it.
Return values
stringthe xpath expression.

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: