Moodle  2.2.1
http://www.collinsharper.com
qtype_calculated_test_dataset_loader Class Reference
Inheritance diagram for qtype_calculated_test_dataset_loader:
Collaboration diagram for qtype_calculated_test_dataset_loader:

Public Member Functions

 __construct ($questionid, array $valuesets)
 get_number_of_items ()
 load_values ($itemnumber)
 datasets_are_synchronised ($category)
 set_are_synchronised ($category, $aresychronised)

Protected Attributes

 $valuesets
 $aresynchronised = array()

Detailed Description

Test implementation of qtype_calculated_dataset_loader. Gets the values from an array passed to the constructor, rather than querying the database.

Definition at line 127 of file helper.php.


Constructor & Destructor Documentation

__construct ( questionid,
array valuesets 
)

Definition at line 131 of file helper.php.


Member Function Documentation

datasets_are_synchronised ( category)

Reimplemented from qtype_calculated_dataset_loader.

Definition at line 144 of file helper.php.

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.

Returns:
int the number of items available.

Reimplemented from qtype_calculated_dataset_loader.

Definition at line 136 of file helper.php.

load_values ( itemnumber)

Actually query the database for the values.

Parameters:
int$itemnumberwhich set of values to load.
Returns:
array name => value;

Reimplemented from qtype_calculated_dataset_loader.

Definition at line 140 of file helper.php.

set_are_synchronised ( category,
aresychronised 
)

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

Parameters:
int$category
bool$aresychronised

Definition at line 153 of file helper.php.


Field Documentation

$aresynchronised = array() [protected]

Definition at line 129 of file helper.php.

$valuesets [protected]

Definition at line 128 of file helper.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations