Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403] [Versions 402 and 403]

Defines the custom question bank view used on the Edit quiz page.

Copyright: 1999 onwards Martin Dougiamas and others {@link http://moodle.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 303 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: custom_view  - X-Ref

Subclass to customise the view of the question bank for the quiz editing screen.

__construct($contexts, $pageurl, $course, $cm, $params, $extraparams)   X-Ref
Constructor.

param: \core_question\local\bank\question_edit_contexts $contexts
param: \moodle_url $pageurl
param: \stdClass $course course settings
param: \stdClass $cm activity settings.
param: \stdClass $quiz quiz settings.

init_column_manager()   X-Ref
Just use the base column manager in this view.

return: void

get_plugin_controls(\core\context $context, int $categoryid)   X-Ref
Don't display plugin controls.

param: \core\context $context
param: int $categoryid
return: string

get_question_bank_plugins()   X-Ref
No description

heading_column()   X-Ref
No description

default_sort()   X-Ref
No description

set_quiz_has_attempts($quizhasattempts)   X-Ref
Let the question bank display know whether the quiz has been attempted,
hence whether some bits of UI, like the add this question to the quiz icon,
should be displayed.

param: bool $quizhasattempts whether the quiz has attempts.

add_to_quiz_url($questionid)   X-Ref
URL of add to quiz.

param: $questionid
return: \moodle_url

render($pagevars, $tabname)   X-Ref
Renders the html question bank (same as display, but returns the result).

Note that you can only output this rendered result once per page, as
it contains IDs which must be unique.

param: array $pagevars
param: string $tabname
return: string HTML code for the form

display_bottom_controls(\context $catcontext)   X-Ref
No description

create_new_question_form($category, $canadd)   X-Ref
Override the base implementation in \core_question\local\bank\view
because we don't want to print new question form in the fragment
for the modal.

param: false|mixed|\stdClass $category
param: bool $canadd

display_question_bank_header()   X-Ref
Override the base implementation in \core_question\local\bank\view
because we don't want to print the headers in the fragment
for the modal.


build_query()   X-Ref
No description

add_standard_search_conditions()   X-Ref
No description

get_quiz()   X-Ref
Return the quiz settings for the quiz this question bank is displayed in.

return: bool|\stdClass