mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-42181 quiz nav: highight all buttons when all Qs on one page
This commit is contained in:
parent
5e6da548d7
commit
0328341f97
@ -1664,7 +1664,7 @@ abstract class quiz_nav_panel_base {
|
||||
$button->stateclass = 'complete';
|
||||
}
|
||||
$button->statestring = $this->get_state_string($qa, $showcorrectness);
|
||||
$button->currentpage = $this->attemptobj->get_question_page($slot) == $this->page;
|
||||
$button->currentpage = $this->showall || $this->attemptobj->get_question_page($slot) == $this->page;
|
||||
$button->flagged = $qa->is_flagged();
|
||||
$button->url = $this->get_question_url($slot);
|
||||
$buttons[] = $button;
|
||||
@ -1715,6 +1715,20 @@ abstract class quiz_nav_panel_base {
|
||||
}
|
||||
return $userpicture;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return 'allquestionsononepage' as CSS class name when $showall is set,
|
||||
* otherwise, return 'multipages' as CSS class name.
|
||||
* @return string, CSS class name
|
||||
*/
|
||||
public function get_button_container_class() {
|
||||
// Quiz navigation is set on 'Show all questions on one page'.
|
||||
if ($this->showall) {
|
||||
return 'allquestionsononepage';
|
||||
}
|
||||
// Quiz navigation is set on 'Show one page at a time'.
|
||||
return 'multipages';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -313,7 +313,8 @@ class mod_quiz_renderer extends plugin_renderer_base {
|
||||
}
|
||||
$output .= $panel->render_before_button_bits($this);
|
||||
|
||||
$output .= html_writer::start_tag('div', array('class' => 'qn_buttons'));
|
||||
$bcc = $panel->get_button_container_class();
|
||||
$output .= html_writer::start_tag('div', array('class' => "qn_buttons $bcc"));
|
||||
foreach ($panel->get_question_buttons() as $button) {
|
||||
$output .= $this->render($button);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user