Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Base class for 'columns' that are actually displayed as a row following the main question row. More...
Public Member Functions | |
display ($question, $rowclasses) | |
Output this column. More... | |
display_header () | |
Output the column header cell. | |
get_extra_classes () | |
get_extra_joins () | |
Return an array 'table_alias' => 'JOIN clause' to bring in any data that this column required. More... | |
get_name () | |
Get the internal name for this column. More... | |
get_required_fields () | |
is_extra_row () | |
is_sortable () | |
Can this column be sorted on? You can return either: More... | |
load_additional_data (array $questions) | |
If this column needs extra data (e.g. More... | |
load_question_tags (array $questions) | |
Load the tags for each question. More... | |
set_as_heading () | |
Set the column as heading. | |
sort_expression ($reverse, $subsort) | |
Protected Member Functions | |
display_content ($question, $rowclasses) | |
Output the contents of this column. More... | |
display_end ($question, $rowclasses) | |
Output the closing column tag. More... | |
display_start ($question, $rowclasses) | |
Output the opening column tag. More... | |
get_classes () | |
get_sort_icon ($reverse) | |
Get an icon representing the corrent sort state. More... | |
get_title () | |
Title for this column. More... | |
get_title_tip () | |
init () | |
A chance for subclasses to initialise themselves, for example to load lang strings, without having to override the constructor. More... | |
make_sort_link ($sort, $title, $tip, $defaultreverse=false) | |
Get a link that changes the sort order, and indicates the current sort state. More... | |
sortorder ($reverse) | |
Helper method for building sort clauses. More... | |
Protected Attributes | |
bool | $isheading = false |
determine whether the column is td or th. | |
view | $qbank |
$qbank the question bank view we are helping to render. | |
Base class for 'columns' that are actually displayed as a row following the main question row.
|
inherited |
Output this column.
object | $question | the row from the $question table, augmented with extra information. |
string | $rowclasses | CSS class names that should be applied to this row of output. |
|
abstractprotectedinherited |
Output the contents of this column.
object | $question | the row from the $question table, augmented with extra information. |
string | $rowclasses | CSS class names that should be applied to this row of output. |
Reimplemented in mod_quiz\question\bank\add_action_column, mod_quiz\question\bank\question_name_text_column, core_question\bank\checkbox_column, core_question\bank\creator_name_column, core_question\bank\edit_menu_column, core_question\bank\menu_action_column_base, core_question\bank\modifier_name_column, core_question\bank\preview_action_column, core_question\bank\question_name_column, core_question\bank\question_name_idnumber_tags_column, core_question\bank\question_text_row, core_question\bank\question_type_column, and core_question\bank\tags_action_column.
|
protected |
Output the closing column tag.
object | $question | |
string | $rowclasses |
Reimplemented from core_question\bank\column_base.
|
protected |
Output the opening column tag.
If it is set as heading, it will use
tag instead of
stdClass | $question | |
string | $rowclasses |
Reimplemented from core_question\bank\column_base.
|
protectedinherited |
string | the CSS classes to apply to every cell in this column. |
|
inherited |
array | any extra class names you would like applied to every cell in this column. |
Reimplemented in core_question\bank\action_column_base.
|
inherited |
Return an array 'table_alias' => 'JOIN clause' to bring in any data that this column required.
The return values for all the columns will be checked. It is OK if two columns join in the same table with the same alias and identical JOIN clauses. If to columns try to use the same alias with different joins, you get an error. The only table included by default is the question table, which is aliased to 'q'.
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.
array | 'table_alias' => 'JOIN clause' |
Reimplemented in core_question\bank\action_column_base, core_question\bank\creator_name_column, core_question\bank\modifier_name_column, and core_question\bank\question_text_row.
|
abstractinherited |
Get the internal name for this column.
Used as a CSS class name, and to store information about the current sort. Must match PARAM_ALPHA.
string | column name. |
Reimplemented in mod_quiz\question\bank\add_action_column, mod_quiz\question\bank\question_name_text_column, core_question\bank\checkbox_column, core_question\bank\copy_action_column, core_question\bank\creator_name_column, core_question\bank\delete_action_column, core_question\bank\edit_action_column, core_question\bank\edit_menu_column, core_question\bank\export_xml_action_column, core_question\bank\modifier_name_column, core_question\bank\preview_action_column, core_question\bank\question_name_column, core_question\bank\question_name_idnumber_tags_column, core_question\bank\question_text_row, core_question\bank\question_type_column, and core_question\bank\tags_action_column.
|
inherited |
array | fields required. use table alias 'q' for the question table, or one of the ones from get_extra_joins. Every field requested must specify a table prefix. |
Reimplemented in mod_quiz\question\bank\question_name_text_column, core_question\bank\action_column_base, core_question\bank\checkbox_column, core_question\bank\creator_name_column, core_question\bank\delete_action_column, core_question\bank\edit_menu_column, core_question\bank\modifier_name_column, core_question\bank\question_name_column, core_question\bank\question_name_idnumber_tags_column, core_question\bank\question_text_row, and core_question\bank\question_type_column.
|
protectedinherited |
Get an icon representing the corrent sort state.
bool | $reverse | sort is descending, not ascending. |
string | HTML image tag. |
|
abstractprotectedinherited |
Title for this column.
Not used if is_sortable returns an array.
Reimplemented in core_question\bank\action_column_base, core_question\bank\checkbox_column, core_question\bank\creator_name_column, core_question\bank\edit_menu_column, core_question\bank\modifier_name_column, core_question\bank\question_name_column, core_question\bank\question_text_row, and core_question\bank\question_type_column.
|
protectedinherited |
string | a fuller version of the name. Use this when get_title() returns something very short, and you want a longer version as a tool tip. |
Reimplemented in core_question\bank\checkbox_column, and core_question\bank\question_type_column.
|
protectedinherited |
A chance for subclasses to initialise themselves, for example to load lang strings, without having to override the constructor.
Reimplemented in mod_quiz\question\bank\add_action_column, core_question\bank\copy_action_column, core_question\bank\delete_action_column, core_question\bank\edit_action_column, core_question\bank\export_xml_action_column, core_question\bank\preview_action_column, core_question\bank\question_text_row, and core_question\bank\tags_action_column.
core_question\bank\row_base::is_extra_row | ( | ) |
Reimplemented from core_question\bank\column_base.
|
inherited |
Can this column be sorted on? You can return either:
mixed | as above. |
Reimplemented in core_question\bank\creator_name_column, core_question\bank\modifier_name_column, core_question\bank\question_name_column, core_question\bank\question_name_idnumber_tags_column, and core_question\bank\question_type_column.
|
inherited |
If this column needs extra data (e.g.
tags) then load that here.
The extra data should be added to the question object in the array. Probably a good idea to check that another column has not already loaded the data you want.
stdClass[] | $questions | the questions that will be displayed. |
Reimplemented in mod_quiz\question\bank\question_name_text_column, and core_question\bank\question_name_idnumber_tags_column.
|
inherited |
Load the tags for each question.
Helper that can be used from load_additional_data();
array | $questions |
|
protectedinherited |
Get a link that changes the sort order, and indicates the current sort state.
string | $sort | the column to sort on. |
string | $title | the link text. |
string | $tip | the link tool-tip text. If empty, defaults to title. |
bool | $defaultreverse | whether the default sort order for this column is descending, rather than ascending. |
string | HTML fragment. |
|
inherited |
bool | $reverse | Whether to sort in the reverse of the default sort order. |
string | $subsort | if is_sortable returns an array of subnames, then this will be one of those. Otherwise will be empty. |
string | some SQL to go in the order by clause. |
|
protectedinherited |
Helper method for building sort clauses.
bool | $reverse | whether the normal direction should be reversed. |
string | 'ASC' or 'DESC' |