Class for loading questions according to various criteria.
More...
|
|
static question_finder | $questionfinder = null |
| | the singleton instance of this class.
|
| |
Class for loading questions according to various criteria.
- Copyright
- 2009 The Open University
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ get_data_cache()
| question_finder::get_data_cache |
( |
| ) |
|
|
protected |
◆ get_instance()
| static question_finder::get_instance |
( |
| ) |
|
|
static |
◆ get_instance_for_cache()
| static question_finder::get_instance_for_cache |
( |
definition | $definition | ) |
|
|
static |
Returns an instance of the data source class that the cache can use for loading data using the other methods specified by this interface.
- Parameters
-
- Return values
-
Implements core_cache\data_source_interface.
◆ get_questions_from_categories()
| question_finder::get_questions_from_categories |
( |
| $categoryids, |
|
|
| $extraconditions, |
|
|
| $extraparams = array() ) |
Get the ids of all the questions in a list of categories.
- Parameters
-
| array | $categoryids | either a category id, or a comma-separated list of category ids, or an array of them. |
| string | $extraconditions | extra conditions to AND with the rest of the where clause. Must use named parameters. |
| array | $extraparams | any parameters used by $extraconditions. |
- Return values
-
| array | questionid => questionid. |
◆ get_questions_from_categories_and_tags_with_usage_counts()
| question_finder::get_questions_from_categories_and_tags_with_usage_counts |
( |
| $categoryids, |
|
|
qubaid_condition | $qubaids, |
|
|
| $extraconditions = '', |
|
|
| $extraparams = [], |
|
|
| $tagids = [] ) |
◆ get_questions_from_categories_with_usage_counts()
| question_finder::get_questions_from_categories_with_usage_counts |
( |
| $categoryids, |
|
|
qubaid_condition | $qubaids, |
|
|
| $extraconditions = '', |
|
|
| $extraparams = [] ) |
◆ load_for_cache()
| question_finder::load_for_cache |
( |
| $key | ) |
|
Loads the data for the key provided ready formatted for caching.
- Parameters
-
| string | int | $key | The key to load. |
- Return values
-
| mixed | What ever data should be returned, or false if it can't be loaded. |
Implements core_cache\data_source_interface.
◆ load_many_for_cache()
| question_finder::load_many_for_cache |
( |
array | $keys | ) |
|
Loads several keys for the cache.
- Parameters
-
| array | $keys | An array of keys each of which will be string|int. |
- Return values
-
| array | An array of matching data items. |
Implements core_cache\data_source_interface.
◆ load_question_data()
| question_finder::load_question_data |
( |
| $questionid | ) |
|
Load a question definition data from the database.
The data will be returned as a plain stdClass object.
- Parameters
-
| int | $questionid | the id of the question to load. |
- Return values
-
| object | question definition loaded from the database. |
The documentation for this class was generated from the following file: