Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
qtype_calculated_test_dataset_loader Class Reference

Test implementation of qtype_calculated_dataset_loader. More...

Inheritance diagram for qtype_calculated_test_dataset_loader:
qtype_calculated_dataset_loader

Public Member Functions

 __construct ($questionid, array $valuesets)
 
 datasets_are_synchronised ($category)
 
 get_number_of_items ()
 Get the number of items (different values) in each dataset used by this question.
 
 get_values ($itemnumber)
 Load a particular set of values for each dataset used by this question.
 
 load_values ($itemnumber)
 Actually query the database for the values.
 
 set_are_synchronised ($category, $aresychronised)
 Allows the test to mock the return value of datasets_are_synchronised().
 

Protected Attributes

 $aresynchronised = []
 
int $itemsavailable = null
 the id of the question we are helping.
 
int $questionid
 the id of the question we are helping.
 
 $valuesets
 

Detailed Description

Test implementation of qtype_calculated_dataset_loader.

Gets the values from an array passed to the constructor, rather than querying the database.

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

Member Function Documentation

◆ datasets_are_synchronised()

qtype_calculated_test_dataset_loader::datasets_are_synchronised ( $category)

Reimplemented from qtype_calculated_dataset_loader.

◆ get_number_of_items()

qtype_calculated_test_dataset_loader::get_number_of_items ( )

Get the number of items (different values) in each dataset used by this question.

This is the minimum number of items in any dataset used by this question.

Return values
intthe number of items available.

Reimplemented from qtype_calculated_dataset_loader.

◆ get_values()

qtype_calculated_dataset_loader::get_values ( $itemnumber)
inherited

Load a particular set of values for each dataset used by this question.

Parameters
int$itemnumberwhich set of values to load. 0 < $itemnumber <= get_number_of_items().
Return values
arrayname => value.

◆ load_values()

qtype_calculated_test_dataset_loader::load_values ( $itemnumber)

Actually query the database for the values.

Parameters
int$itemnumberwhich set of values to load.
Return values
arrayname => value;

Reimplemented from qtype_calculated_dataset_loader.

◆ set_are_synchronised()

qtype_calculated_test_dataset_loader::set_are_synchronised ( $category,
$aresychronised )

Allows the test to mock the return value of datasets_are_synchronised().

Parameters
int$category
bool$aresychronised

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