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

This class controls from which category questions are listed. More...

Inheritance diagram for core_question\bank\search\category_condition:
core_question\bank\search\condition mod_quiz\question\bank\filter\custom_category_condition

Public Member Functions

 __construct ($cat, $recurse, $contexts, $baseurl, $course, $maxinfolength=null)
 Constructor.
 
 display_options ()
 Called by question_bank_view to display the GUI for selecting a category.
 
 display_options_adv ()
 Displays the recursion checkbox GUI.
 
 params ()
 Return parameters to be bound to the above WHERE clause fragment.
 
 where ()
 SQL fragment to add to the where clause.
 

Protected Member Functions

 display_category_form ($contexts, $pageurl, $current)
 Display the drop down to select the category.
 
 get_current_category ($categoryandcontext)
 Look up the category record based on cateogry ID and context.
 
 print_category_info ($category)
 Print the category description.
 

Protected Attributes

moodle_url $baseurl
 The URL the form is submitted to.
 
string $cat
 categoryID,contextID as used with question_bank_view->display().
 
stdClass $category
 The category record.
 
array $contexts
 of contexts.
 
stdClass $course
 The course record.
 
int $maxinfolength
 The maximum displayed length of the category info.
 
array $params
 query param used in where.
 
bool $recurse
 Whether to include questions from sub-categories.
 
string $where
 SQL fragment to add to the where clause.
 

Detailed Description

This class controls from which category questions are listed.

Author
2021 Safat Shahin safat.nosp@m.shah.nosp@m.in@ca.nosp@m.taly.nosp@m.st-au.nosp@m..net
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core_question\bank\search\category_condition::__construct ( $cat,
$recurse,
$contexts,
$baseurl,
$course,
$maxinfolength = null )

Constructor.

Parameters
string$catcategoryID,contextID as used with question_bank_view->display()
bool$recurseWhether to include questions from sub-categories
array$contextsContext objects as used by question_category_options()
moodle_url$baseurlThe URL the form is submitted to
stdClass$courseCourse record
integer$maxinfolengthThe maximum displayed length of the category info.

Member Function Documentation

◆ display_category_form()

core_question\bank\search\category_condition::display_category_form ( $contexts,
$pageurl,
$current )
protected

Display the drop down to select the category.

Parameters
array$contextsof contexts that can be accessed from here.
moodle_url$pageurlthe URL of this page.
string$current'categoryID,contextID'.
Deprecated
since Moodle 4.0

◆ display_options()

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

Called by question_bank_view to display the GUI for selecting a category.

Reimplemented from core_question\bank\search\condition.

Reimplemented in mod_quiz\question\bank\filter\custom_category_condition.

◆ display_options_adv()

core_question\bank\search\category_condition::display_options_adv ( )

Displays the recursion checkbox GUI.

question_bank_view places this within the section that is hidden by default

Reimplemented from core_question\bank\search\condition.

◆ get_current_category()

core_question\bank\search\category_condition::get_current_category ( $categoryandcontext)
protected

Look up the category record based on cateogry ID and context.

Parameters
string$categoryandcontextcategoryID,contextID as used with question_bank_view->display()
Return values
stdClassThe category record

◆ params()

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

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

Return values
arrayparameter name => value.

Reimplemented from core_question\bank\search\condition.

◆ print_category_info()

core_question\bank\search\category_condition::print_category_info ( $category)
protected

Print the category description.

Parameters
stdClass$categorythe category information form the database.

◆ where()

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

SQL fragment to add to the where clause.

Return values
string

Reimplemented from core_question\bank\search\condition.


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