Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Attributes | List of all members
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. More...
 
 get_values ($itemnumber)
 Load a particular set of values for each dataset used by this question. More...
 
 load_values ($itemnumber)
 Actually query the database for the values. More...
 
 set_are_synchronised ($category, $aresychronised)
 Allows the test to mock the return value of datasets_are_synchronised(). More...
 

Protected Attributes

 $aresynchronised = array()
 
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

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