Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 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: 334 lines (13 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, $quiz)   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.

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.

preview_question_url($question)   X-Ref
Question preview url.

return: \moodle_url
param: \stdClass $question

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

return: \moodle_url
param: $questionid

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.

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

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

create_new_question_form($category, $canadd)   X-Ref
No description

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.


init_sort_from_params()   X-Ref
Override the base implementation in \core_question\bank\view
because we don't want it to read from the $_POST global variables
for the sort parameters since they are not present in a fragment.

Unfortunately the best we can do is to look at the URL for
those parameters (only marginally better really).

build_query()   X-Ref
No description

wanted_filters($cat, $tagids, $showhidden, $recurse, $editcontexts, $showquestiontext)   X-Ref
No description