Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_question\bank\search\tag_condition Class Reference

Question bank search class to allow searching/filtering by tags on a question. More...

Inheritance diagram for core_question\bank\search\tag_condition:
core_question\bank\search\condition

Public Member Functions

 __construct (array $contexts, array $selectedtagids=[])
 Constructor.
 
 display_options ()
 Print HTML to display the list of tags to filter by.
 
 display_options_adv ()
 Display GUI for selecting criteria for this condition.
 
 params ()
 Named SQL params to be used with the SQL WHERE snippet.
 
 where ()
 Get the SQL WHERE snippet to be used in the SQL to retrieve the list of questions.
 

Protected Attributes

array $contexts
 List of contexts to show tags from.
 
array $params
 Named SQL params to be used with the SQL WHERE snippet.
 
array $selectedtagids
 List of IDs for tags that have been selected in the form.
 
string $where
 SQL fragment to add to the where clause.
 

Detailed Description

Question bank search class to allow searching/filtering by tags on a question.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core_question\bank\search\tag_condition::__construct ( array $contexts,
array $selectedtagids = [] )

Constructor.

Parameters
array$contextsList of contexts to show tags from
int[]$selectedtagidsList of IDs for tags to filter by.
Exceptions
coding_exception
dml_exception

Member Function Documentation

◆ display_options()

core_question\bank\search\tag_condition::display_options ( )

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

Reimplemented from core_question\bank\search\condition.

◆ display_options_adv()

core_question\bank\search\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

Reimplemented in core_question\bank\search\category_condition, and core_question\bank\search\hidden_condition.

◆ params()

core_question\bank\search\tag_condition::params ( )

Named SQL params to be used with the SQL WHERE snippet.

Return values
array

Reimplemented from core_question\bank\search\condition.

◆ where()

core_question\bank\search\tag_condition::where ( )

Get the SQL WHERE snippet to be used in the SQL to retrieve the list of questions.

This SQL snippet will add the logic for the tag condition.

Return values
string

Reimplemented from core_question\bank\search\condition.


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