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

This class is responsible for loading the dataset that a question needs from the database. More...

Inheritance diagram for qtype_calculated_dataset_loader:
qtype_calculated_test_dataset_loader

Public Member Functions

 __construct ($questionid)
 Constructor.
 
 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.
 

Protected Member Functions

 load_values ($itemnumber)
 Actually query the database for the values.
 

Protected Attributes

int $itemsavailable = null
 the id of the question we are helping.
 
int $questionid
 the id of the question we are helping.
 

Detailed Description

This class is responsible for loading the dataset that a question needs from the database.

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

Constructor & Destructor Documentation

◆ __construct()

qtype_calculated_dataset_loader::__construct ( $questionid)

Constructor.

Parameters
int$questionidthe question to load datasets for.

Member Function Documentation

◆ get_number_of_items()

qtype_calculated_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 in qtype_calculated_test_dataset_loader.

◆ get_values()

qtype_calculated_dataset_loader::get_values ( $itemnumber)

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_dataset_loader::load_values ( $itemnumber)
protected

Actually query the database for the values.

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

Reimplemented in qtype_calculated_test_dataset_loader.


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