Search moodle.org's
Developer Documentation

See Release Notes

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

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402] [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: 337 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.

param: \stdClass $question
return: \moodle_url

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
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