Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_question\local\bank\view_component Class Reference
Inheritance diagram for core_question\local\bank\view_component:
core_question\local\bank\column_action_base core_question\local\bank\column_base core_question\local\bank\question_action_base qbank_columnsortorder\local\bank\column_action_move qbank_columnsortorder\local\bank\column_action_remove qbank_columnsortorder\local\bank\column_action_resize core_question\local\bank\action_column_base core_question\local\bank\checkbox_column core_question\local\bank\edit_menu_column core_question\local\bank\row_base mod_quiz\question\bank\add_action_column mod_quiz\question\bank\preview_action_column mod_quiz\question\bank\question_name_column qbank_comment\comment_count_column qbank_customfields\custom_field_column qbank_editquestion\question_status_column qbank_history\version_number_column qbank_statistics\columns\discrimination_index qbank_statistics\columns\discriminative_efficiency qbank_statistics\columns\facility_index qbank_usage\question_last_used_column qbank_usage\question_usage_column qbank_viewcreator\creator_name_column qbank_viewcreator\modifier_name_column qbank_viewquestionname\viewquestionname_column_helper qbank_viewquestiontype\question_type_column qbank_deletequestion\delete_action qbank_editquestion\copy_action qbank_editquestion\edit_action qbank_exporttoxml\export_xml_action qbank_history\history_action qbank_previewquestion\preview_action qbank_tagquestion\tags_action

Public Member Functions

 __construct (view $qbank)
 Constructor.
 
 get_extra_joins ()
 Return an array 'table_alias' => 'JOIN clause' to bring in any data that this feature requires.
 
 get_menu_position ()
 Return an integer to indicate the desired position in the menu for this link, smaller at the top.
 
 get_required_fields ()
 Use table alias 'q' for the question table, or one of the ones from get_extra_joins.
 

Public Attributes

int const MENU_POSITION_NOT_SET = 6666
 value we return from get_menu_position here.
 

Protected Member Functions

 init ()
 A chance for subclasses to initialise themselves, for example to load lang strings, without having to override the constructor.
 

Protected Attributes

view $qbank
 Question bank view.
 

Constructor & Destructor Documentation

◆ __construct()

core_question\local\bank\view_component::__construct ( view $qbank)

Constructor.

Parameters
view$qbankthe question bank view we are helping to render.

Member Function Documentation

◆ get_extra_joins()

core_question\local\bank\view_component::get_extra_joins ( )

Return an array 'table_alias' => 'JOIN clause' to bring in any data that this feature requires.

The return values for all the features will be checked. It is OK if two features join in the same table with the same alias and identical JOIN clauses. If two features try to use the same alias with different joins, you get an error. Tables included by default are question (alias q) and those defined in {

See also
view\get_required_joins()}

It is importnat that your join simply adds additional data (or NULLs) to the existing rows of the query. It must not cause additional rows.

Return values
string[]'table_alias' => 'JOIN clause'

Reimplemented in core_question\local\bank\action_column_base, core_question\local\bank\column_base, qbank_viewcreator\creator_name_column, and qbank_viewcreator\modifier_name_column.

◆ get_menu_position()

core_question\local\bank\view_component::get_menu_position ( )

Return an integer to indicate the desired position in the menu for this link, smaller at the top.

The standard menu items in Moodle core return these numbers: 100 preview_action 200 edit_action 250 copy_action 300 tags_action 400 delete_action 500 history_action 600 export_xml_action (So, if you want your action at a particular place in the order, there should be space.)

If two actions get the same order number, then the tie-break on the sort is plugin name, then the order returned by get_question_actions for that plugin.

Return values
intdesired position. Smallest at the top.

Reimplemented in qbank_deletequestion\delete_action, qbank_editquestion\copy_action, qbank_editquestion\edit_action, qbank_exporttoxml\export_xml_action, qbank_history\history_action, qbank_previewquestion\preview_action, and qbank_tagquestion\tags_action.

◆ get_required_fields()

◆ init()

Member Data Documentation

◆ MENU_POSITION_NOT_SET

int const core_question\local\bank\view_component::MENU_POSITION_NOT_SET = 6666

value we return from get_menu_position here.

Subclasses should override this.


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