Moodle PHP Documentation 5.0
Moodle 5.0.1+ (Build: 20250711) (61af040cd5f)
|
Public Member Functions | |
get_bulk_action_capabilities () | |
Get the capabilities for the bulk action. | |
get_bulk_action_key () | |
get_bulk_action_title () | |
Title of the bulk action. | |
get_bulk_action_url () | |
URL of the bulk action redirect page. | |
get_extra_joins () | |
Return an array 'table_alias' => 'JOIN clause' to bring in any data that this feature requires. | |
get_key () | |
A unique key for the bulk action, this will be used in the api to identify the action data. | |
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. | |
initialise_javascript () | |
Initialise the modal js with the current bank context id and question category id. | |
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. | |
qbank_bulkmove\bulk_move_action::get_bulk_action_capabilities | ( | ) |
Get the capabilities for the bulk action.
The bulk actions might have some capabilities to action them as a user. This method helps to get those caps which will be used by the base view before actioning the bulk action. For ex: ['moodle/question:moveall', 'moodle/question:add'] At least one of the cap need to be true for the user to use this action.
array|null |
Reimplemented from core_question\local\bank\bulk_action_base.
|
inherited |
qbank_bulkmove\bulk_move_action::get_bulk_action_title | ( | ) |
Title of the bulk action.
Every bulk action will have a string to show in the list.
string |
Reimplemented from core_question\local\bank\bulk_action_base.
qbank_bulkmove\bulk_move_action::get_bulk_action_url | ( | ) |
URL of the bulk action redirect page.
Bulk action can be performed by redirecting to a page and doing the appropriate selection and finally doing the action. The url will be url of the page where users will be redirected to select what to do with the selected questions.
moodle_url |
Reimplemented from core_question\local\bank\bulk_action_base.
|
inherited |
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 {
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.
string[] | 'table_alias' => 'JOIN clause' |
Reimplemented in core_question\local\bank\column_base, qbank_viewcreator\creator_name_column, and qbank_viewcreator\modifier_name_column.
qbank_bulkmove\bulk_move_action::get_key | ( | ) |
A unique key for the bulk action, this will be used in the api to identify the action data.
Every bulk must have a unique key to perform the action as a part of the form post in the base view. When questions are selected, it will post according to the key its selected from the dropdown.
string |
Reimplemented from core_question\local\bank\bulk_action_base.
|
inherited |
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 500 history_action 600 export_xml_action 2000 delete_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.
int | desired 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.
|
inherited |
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.
string[] | fields required. |
Reimplemented in core_question\local\bank\checkbox_column, core_question\local\bank\column_base, core_question\local\bank\edit_menu_column, mod_quiz\question\bank\question_name_column, mod_quiz\question\bank\question_name_text_column, qbank_viewcreator\creator_name_column, qbank_viewcreator\modifier_name_column, qbank_viewquestionname\question_name_idnumber_tags_column, qbank_viewquestionname\viewquestionname_column_helper, qbank_viewquestiontext\question_text_row, and qbank_viewquestiontype\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 core_question\local\bank\column_action_base, mod_quiz\question\bank\add_action_column, qbank_columnsortorder\local\bank\column_action_move, qbank_columnsortorder\local\bank\column_action_remove, qbank_columnsortorder\local\bank\column_action_resize, qbank_comment\comment_count_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, qbank_usage\question_usage_column, and qbank_viewquestiontext\question_text_row.
qbank_bulkmove\bulk_move_action::initialise_javascript | ( | ) |
Initialise the modal js with the current bank context id and question category id.
void |
Reimplemented from core_question\local\bank\bulk_action_base.
|
inherited |
value we return from get_menu_position here.
Subclasses should override this.