Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
mod_quiz\output\navigation_panel_base Class Reference
Inheritance diagram for mod_quiz\output\navigation_panel_base:
mod_quiz\output\navigation_panel_attempt mod_quiz\output\navigation_panel_review

Public Member Functions

 __construct (quiz_attempt $attemptobj, question_display_options $options, $page, $showall)
 Constructor.
 
 get_button_container_class ()
 Return 'allquestionsononepage' as CSS class name when $showall is set, otherwise, return 'multipages' as CSS class name.
 
 get_question_buttons ()
 Get the buttons and section headings to go in the quiz navigation block.
 
 render_before_button_bits (renderer $output)
 Hook for subclasses to override to do output above the question buttons.
 
 render_end_bits (renderer $output)
 Hook that subclasses must override to do output after the question buttons.
 
 user_picture ()
 Get the user picture which should be displayed, if required.
 

Protected Member Functions

 get_question_url ($slot)
 Get the URL to navigate to a particular question.
 
 get_state_string (question_attempt $qa, $showcorrectness)
 Get the human-readable description of the current state of a particular question.
 
 render_restart_preview_link ($output)
 Render the restart preview button.
 

Protected Attributes

quiz_attempt $attemptobj
 
question_display_options $options
 
integer $page
 
boolean $showall
 

Detailed Description

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

mod_quiz\output\navigation_panel_base::__construct ( quiz_attempt $attemptobj,
question_display_options $options,
$page,
$showall )

Constructor.

Parameters
quiz_attempt$attemptobjconstruct the panel for this attempt.
question_display_options$optionsdisplay options in force.
int$pagewhich page of the quiz attempt is being shown, -1 if all.
bool$showallwhether all pages are being shown at once.

Member Function Documentation

◆ get_button_container_class()

mod_quiz\output\navigation_panel_base::get_button_container_class ( )

Return 'allquestionsononepage' as CSS class name when $showall is set, otherwise, return 'multipages' as CSS class name.

Return values
string,CSSclass name

◆ get_question_buttons()

mod_quiz\output\navigation_panel_base::get_question_buttons ( )

Get the buttons and section headings to go in the quiz navigation block.

Return values
renderable[]the buttons, possibly interleaved with section headings.

◆ get_question_url()

mod_quiz\output\navigation_panel_base::get_question_url ( $slot)
abstractprotected

Get the URL to navigate to a particular question.

Parameters
int$slotslot number, to identify the question.
Return values
moodle_url|nullURL if the user can navigate there, or null if they cannot.

Reimplemented in mod_quiz\output\navigation_panel_attempt, and mod_quiz\output\navigation_panel_review.

◆ get_state_string()

mod_quiz\output\navigation_panel_base::get_state_string ( question_attempt $qa,
$showcorrectness )
protected

Get the human-readable description of the current state of a particular question.

Parameters
question_attempt$qathe attempt at the question of interest.
bool$showcorrectnesswhether the current use is allowed to see if they have got the question right.
Return values
stringHuman-readable description of the state.

◆ render_before_button_bits()

mod_quiz\output\navigation_panel_base::render_before_button_bits ( renderer $output)

Hook for subclasses to override to do output above the question buttons.

Parameters
renderer$outputthe quiz renderer to use.
Return values
stringHTML to output.

Reimplemented in mod_quiz\output\navigation_panel_attempt.

◆ render_end_bits()

mod_quiz\output\navigation_panel_base::render_end_bits ( renderer $output)
abstract

Hook that subclasses must override to do output after the question buttons.

Parameters
renderer$outputthe quiz renderer to use.
Return values
stringHTML to output.

Reimplemented in mod_quiz\output\navigation_panel_attempt, and mod_quiz\output\navigation_panel_review.

◆ render_restart_preview_link()

mod_quiz\output\navigation_panel_base::render_restart_preview_link ( $output)
protected

Render the restart preview button.

Parameters
renderer$outputthe quiz renderer to use.
Return values
stringHTML to output.

◆ user_picture()

mod_quiz\output\navigation_panel_base::user_picture ( )

Get the user picture which should be displayed, if required.

Return values
user_picture|null

The documentation for this class was generated from the following file: