Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Attributes | List of all members
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. More...
 
 display_options ()
 Print HTML to display the list of tags to filter by.
 
 display_options_adv ()
 Display GUI for selecting criteria for this condition. More...
 
 params ()
 Named SQL params to be used with the SQL WHERE snippet. More...
 
 where ()
 Get the SQL WHERE snippet to be used in the SQL to retrieve the list of questions. More...
 

Protected Attributes

string $contexts
 SQL fragment to add to the where clause.
 
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
context[]$contextsList of contexts to show tags from
int[]$selectedtagidsList of IDs for tags to filter by.

Member Function Documentation

◆ 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
stringHTML form fragment

Reimplemented in core_question\bank\search\hidden_condition, and core_question\bank\search\category_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: