|
| allow_custom () |
| Whether customisation is allowed.
|
|
| allow_empty () |
| Whether empty value is allowed.
|
|
| allow_multiple () |
| Whether multiple values are allowed .
|
|
| display_options () |
| Display GUI for selecting criteria for this condition.
|
|
| display_options_adv () |
| Display GUI for selecting criteria for this condition.
|
|
| filter_invalid_values (array $filterconditions) |
| Method to be overridden in condition classes to filter out anything invalid from the filterconditions array.
|
|
| get_condition_class () |
| Return this condition class.
|
|
| get_filter_class () |
| Return the Javascript filter class to provide the UI for this condition.
|
|
| get_filteroptions () |
| Extra data specific to this condition.
|
|
| get_initial_values () |
| Build a list of the available question types.
|
|
| get_join_list () |
| Get the list of available joins for the filter.
|
|
| get_title () |
| Return title of the condition.
|
|
| is_required () |
| Whether this filter is required - if so it cannot be removed from the list of filters.
|
|
| params () |
| Return parameters to be bound to the above WHERE clause fragment.
|
|
| where () |
| Return an SQL fragment to be ANDed into the WHERE clause to filter which questions are shown.
|
|
|
static | build_query_from_filter (array $filter) |
| Build a WHERE condition to filter the q.qtype column by the selected question types.
|
|
static | get_condition_key () |
| Each condition will need a unique key to be identified and sequenced by the api.
|
|
static | get_filter_from_list (array $filters) |
| Given an array of filters, pick the entry that matches the condition key and return it.
|
|
|
array array | $filter |
| Filter properties for this condition.
|
|
int const | JOINTYPE_DEFAULT = datafilter::JOINTYPE_ANY |
| The default filter type.
|
|
|
array array | $params = [] |
| query param used in where.
|
|
string string | $where = '' |
| SQL fragment to add to the where clause.
|
|
◆ allow_custom()
qbank_viewquestiontype\type_condition::allow_custom |
( |
| ) |
|
◆ allow_empty()
core_question\local\bank\condition::allow_empty |
( |
| ) |
|
|
inherited |
◆ allow_multiple()
core_question\local\bank\condition::allow_multiple |
( |
| ) |
|
|
inherited |
◆ build_query_from_filter()
static qbank_viewquestiontype\type_condition::build_query_from_filter |
( |
array | $filter | ) |
|
|
static |
Build a WHERE condition to filter the q.qtype column by the selected question types.
- Parameters
-
- Return values
-
- Exceptions
-
Reimplemented from core_question\local\bank\condition.
◆ display_options()
core_question\local\bank\condition::display_options |
( |
| ) |
|
|
inherited |
◆ display_options_adv()
core_question\local\bank\condition::display_options_adv |
( |
| ) |
|
|
inherited |
◆ filter_invalid_values()
core_question\local\bank\condition::filter_invalid_values |
( |
array | $filterconditions | ) |
|
|
inherited |
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 in qbank_managecategories\category_condition.
◆ get_condition_class()
core_question\local\bank\condition::get_condition_class |
( |
| ) |
|
|
inherited |
Return this condition class.
- Return values
-
◆ get_condition_key()
static qbank_viewquestiontype\type_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_filter_class()
qbank_viewquestiontype\type_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()
core_question\local\bank\condition::get_filteroptions |
( |
| ) |
|
|
inherited |
◆ get_initial_values()
qbank_viewquestiontype\type_condition::get_initial_values |
( |
| ) |
|
◆ get_join_list()
qbank_viewquestiontype\type_condition::get_join_list |
( |
| ) |
|
Get the list of available joins for the filter.
Questions can be ANY or NONE of the selected types. Since questions cannot have multiple types, allowing "ALL" does not make sense here.
- Return values
-
Reimplemented from core_question\local\bank\condition.
◆ get_title()
qbank_viewquestiontype\type_condition::get_title |
( |
| ) |
|
◆ is_required()
core_question\local\bank\condition::is_required |
( |
| ) |
|
|
inherited |
◆ 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. |
◆ 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/viewquestiontype/classes/type_condition.php