Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
qbank_tagquestion\tag_condition Class Reference
Inheritance diagram for qbank_tagquestion\tag_condition:
core_question\local\bank\condition

Public Member Functions

 __construct ($qbank=null)
 Tag condition constructor.
 
 allow_custom ()
 Whether customisation is allowed.
 
 allow_empty ()
 Whether empty value is allowed.
 
 allow_multiple ()
 Whether multiple values are allowed .
 
 display_options ()
 Print HTML to display the list of tags to filter by.
 
 display_options_adv ()
 Display GUI for selecting criteria for this condition.
 
 get_condition_class ()
 Return this condition class.
 
 get_filter_class ()
 Return filter class associated with this condition.
 
 get_filteroptions ()
 Extra data specific to this condition.
 
 get_initial_values ()
 Initial values of the condition.
 
 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 Public Member Functions

static build_query_from_filter (array $filter)
 Build query from filter value.
 
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.
 

Public Attributes

array array $filter
 Filter properties for this condition.
 
int const JOINTYPE_DEFAULT = datafilter::JOINTYPE_ALL
 The default filter type.
 

Protected Attributes

array $contexts = []
 Contexts to be used.
 
array array $params = []
 query param used in where.
 
array $selectedtagids = []
 List of IDs for tags that have been selected in the form.
 
string string $where = ''
 SQL fragment to add to the where clause.
 

Constructor & Destructor Documentation

◆ __construct()

qbank_tagquestion\tag_condition::__construct ( $qbank = null)

Tag condition constructor.

It uses the qbank object and initialises all the its required information to be passed as a part of condition to get the questions.

Parameters
null$qbankqbank view

Member Function Documentation

◆ allow_custom()

qbank_tagquestion\tag_condition::allow_custom ( )

Whether customisation is allowed.

Return values
bool

Reimplemented from core_question\local\bank\condition.

◆ allow_empty()

core_question\local\bank\condition::allow_empty ( )
inherited

Whether empty value is allowed.

Return values
bool

Reimplemented in qbank_managecategories\category_condition.

◆ allow_multiple()

core_question\local\bank\condition::allow_multiple ( )
inherited

Whether multiple values are allowed .

Return values
bool

Reimplemented in qbank_managecategories\category_condition.

◆ build_query_from_filter()

static qbank_tagquestion\tag_condition::build_query_from_filter ( array $filter)
static

Build query from filter value.

Parameters
array$filterfilter properties
Return values
arraywhere sql and params

Reimplemented from core_question\local\bank\condition.

◆ display_options()

qbank_tagquestion\tag_condition::display_options ( )

Print HTML to display the list of tags to filter by.

Reimplemented from core_question\local\bank\condition.

◆ display_options_adv()

core_question\local\bank\condition::display_options_adv ( )
inherited

Display GUI for selecting criteria for this condition.

Displayed when Show More is open.

Compare display_options(), which displays always, whether Show More is open or not.

Return values
bool|stringHTML form fragment
Deprecated
since Moodle 4.0 MDL-72321 - please do not use this function any more.
Todo
Final deprecation on Moodle 4.1 MDL-72572

Reimplemented in qbank_managecategories\category_condition.

◆ get_condition_class()

core_question\local\bank\condition::get_condition_class ( )
inherited

Return this condition class.

Return values
string

◆ get_condition_key()

static qbank_tagquestion\tag_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
string

Reimplemented from core_question\local\bank\condition.

◆ get_filter_class()

qbank_tagquestion\tag_condition::get_filter_class ( )

Return filter class associated with this condition.

Return values
stringfilter class

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$filtersArray of filters, keyed by condition.
Return values
?arrayThe filter that matches this condition

◆ get_filteroptions()

core_question\local\bank\condition::get_filteroptions ( )
inherited

Extra data specific to this condition.

Return values
stdClass

Reimplemented in qbank_managecategories\category_condition.

◆ get_initial_values()

qbank_tagquestion\tag_condition::get_initial_values ( )

Initial values of the condition.

Return values
array

Reimplemented from core_question\local\bank\condition.

◆ get_join_list()

core_question\local\bank\condition::get_join_list ( )
inherited

Get the list of available joins for the filter.

Return values
array

Reimplemented in qbank_deletequestion\hidden_condition, and qbank_managecategories\category_condition.

◆ get_title()

qbank_tagquestion\tag_condition::get_title ( )

Return title of the condition.

Return values
stringtitle of the condition

Reimplemented from core_question\local\bank\condition.

◆ is_required()

core_question\local\bank\condition::is_required ( )
inherited

Whether this filter is required - if so it cannot be removed from the list of filters.

Return values
bool

Reimplemented in qbank_deletequestion\hidden_condition, and qbank_managecategories\category_condition.

◆ params()

core_question\local\bank\condition::params ( )
inherited

Return parameters to be bound to the above WHERE clause fragment.

Return values
arrayparameter 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
stringSQL fragment. Must use named parameters.

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