Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
behat_core_question_generator Class Reference

Behat data generator for core_question. More...

Inheritance diagram for behat_core_question_generator:

Protected Member Functions

 get_creatable_entities ()
 
 get_createdbyuser_id (string $username)
 Look up the id of the createdby user from their username.
 
 get_modifiedbyuser_id (string $username)
 Look up the id of the modifiedby user from their username.
 
 get_question_id (string $questionname)
 Look up the id of a question from its name.
 
 process_updated_question (array $data)
 Update a question.
 

Detailed Description

Behat data generator for core_question.

Member Function Documentation

◆ get_createdbyuser_id()

behat_core_question_generator::get_createdbyuser_id ( string $username)
protected

Look up the id of the createdby user from their username.

Parameters
string$usernameThe username for the createdby user.
Return values
intThe user ID.

◆ get_modifiedbyuser_id()

behat_core_question_generator::get_modifiedbyuser_id ( string $username)
protected

Look up the id of the modifiedby user from their username.

Parameters
string$usernameThe username for the modifiedby user.
Return values
intThe user ID.

◆ get_question_id()

behat_core_question_generator::get_question_id ( string $questionname)
protected

Look up the id of a question from its name.

Parameters
string$questionnamethe question name, for example 'Question 1'.
Return values
intcorresponding id.

◆ process_updated_question()

behat_core_question_generator::process_updated_question ( array $data)
protected

Update a question.

This will update a question matching the supplied name with the provided data, creating a new version in the process.

Parameters
array$datathe row of data from the behat script.
Return values
void

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