|
array array | $filter |
| Filter properties for this condition.
|
|
bool | $includesubcategories |
| Include questions in subcategories of the specified category?
|
|
int | $maxinfolength |
| The maximum displayed length of the category info.
|
|
int const | JOINTYPE_DEFAULT = datafilter::JOINTYPE_ANY |
| The default filter type.
|
|
|
string | $cat |
| categoryID,contextID as used with question_bank_view->display().
|
|
stdClass | $category |
| The category record.
|
|
stdClass stdClass | $cm |
| The course_modules record.
|
|
array | $contexts |
| of contexts.
|
|
stdClass | $course |
| The course record.
|
|
array array | $params = [] |
| query param used in where.
|
|
string string | $where = '' |
| SQL fragment to add to the where clause.
|
|
◆ __construct()
qbank_managecategories\category_condition::__construct |
( |
?view | $qbank = null | ) |
|
◆ allow_custom()
qbank_managecategories\category_condition::allow_custom |
( |
| ) |
|
◆ allow_empty()
qbank_managecategories\category_condition::allow_empty |
( |
| ) |
|
◆ allow_multiple()
qbank_managecategories\category_condition::allow_multiple |
( |
| ) |
|
◆ build_query_from_filter()
static qbank_managecategories\category_condition::build_query_from_filter |
( |
array | $filter | ) |
|
|
static |
Return the SQL WHERE condition and parameters to be ANDed with other filter conditions.
The $filter parameter recieves an array with a 'values' key, containing an array of the filter values selected, and a 'jointype' key containing the selected join type.
- Parameters
-
array | $filter | filter properties |
- Return values
-
array | ['SQL where condition', ['param1' => 'value1', 'param2' => 'value2', ...]] |
Reimplemented from core_question\local\bank\condition.
◆ display_category_form()
qbank_managecategories\category_condition::display_category_form |
( |
| $contexts, |
|
|
| $pageurl, |
|
|
| $current ) |
|
protected |
◆ display_options()
qbank_managecategories\category_condition::display_options |
( |
| ) |
|
◆ display_options_adv()
qbank_managecategories\category_condition::display_options_adv |
( |
| ) |
|
◆ filter_invalid_values()
qbank_managecategories\category_condition::filter_invalid_values |
( |
array | $filterconditions | ) |
|
Method to be overridden in condition classes to filter out anything invalid from the filterconditions array.
This can be applied anywhere where the $filterconditions array exists, to let condition plugins remove elements from the array, based on their own internal logic/validation. For example, this is used on the /mod/quiz/editrandom.php page to filter out question categories which no longer exist, which previously broke the editrandom page.
- Parameters
-
- Return values
-
Reimplemented from core_question\local\bank\condition.
◆ get_category_record()
static qbank_managecategories\category_condition::get_category_record |
( |
| $categoryid, |
|
|
| $contextid ) |
|
static |
Fetch the question category record matching the provided category and context IDs.
- Parameters
-
int | $categoryid | |
int | $contextid | |
- Return values
-
- Exceptions
-
◆ get_condition_class()
core_question\local\bank\condition::get_condition_class |
( |
| ) |
|
|
inherited |
Return this condition class.
- Return values
-
◆ get_condition_key()
static qbank_managecategories\category_condition::get_condition_key |
( |
| ) |
|
|
static |
Each condition will need a unique key to be identified and sequenced by the api.
Use a unique string for the condition identifier, use string directly, dont need to use language pack. Using language pack might break the filter object for multilingual support.
- Return values
-
Reimplemented from core_question\local\bank\condition.
◆ get_course_id()
qbank_managecategories\category_condition::get_course_id |
( |
| ) |
|
Returns course id.
- Return values
-
◆ get_current_category()
static qbank_managecategories\category_condition::get_current_category |
( |
| $categoryandcontext | ) |
|
|
static |
◆ get_default_category()
qbank_managecategories\category_condition::get_default_category |
( |
| ) |
|
Return default category.
- Return values
-
◆ get_filter_class()
qbank_managecategories\category_condition::get_filter_class |
( |
| ) |
|
Return the Javascript filter class to provide the UI for this condition.
If left as null, this will use the default core/datafilter/filtertype class. Otherwise, override it to return the full path to the Javascript module path for the class.
- Return values
-
Reimplemented from core_question\local\bank\condition.
◆ get_filter_from_list()
static core_question\local\bank\condition::get_filter_from_list |
( |
array | $filters | ) |
|
|
staticinherited |
Given an array of filters, pick the entry that matches the condition key and return it.
- Parameters
-
array | $filters | Array of filters, keyed by condition. |
- Return values
-
?array | The filter that matches this condition |
◆ get_filteroptions()
qbank_managecategories\category_condition::get_filteroptions |
( |
| ) |
|
◆ get_initial_values()
qbank_managecategories\category_condition::get_initial_values |
( |
| ) |
|
◆ get_join_list()
qbank_managecategories\category_condition::get_join_list |
( |
| ) |
|
◆ get_title()
qbank_managecategories\category_condition::get_title |
( |
| ) |
|
◆ is_required()
qbank_managecategories\category_condition::is_required |
( |
| ) |
|
◆ params()
core_question\local\bank\condition::params |
( |
| ) |
|
|
inherited |
Return parameters to be bound to the above WHERE clause fragment.
- Return values
-
array | parameter name => value. |
◆ print_category_info()
qbank_managecategories\category_condition::print_category_info |
( |
| $category | ) |
|
|
protected |
◆ print_choose_category_message()
static qbank_managecategories\category_condition::print_choose_category_message |
( |
| ) |
|
|
static |
◆ validate_category_param()
static qbank_managecategories\category_condition::validate_category_param |
( |
string | $categoryandcontext | ) |
|
|
static |
Return category and context ID from compound parameter.
- Parameters
-
string | $categoryandcontext | Comma-separated list of category and context IDs. |
- Return values
-
◆ where()
core_question\local\bank\condition::where |
( |
| ) |
|
|
inherited |
Return an SQL fragment to be ANDed into the WHERE clause to filter which questions are shown.
- Return values
-
string | SQL fragment. Must use named parameters. |
The documentation for this class was generated from the following file:
- question/bank/managecategories/classes/category_condition.php