Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'wip-MDL-55930-31' of https://github.com/Beedell/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_31_STABLE
  • Loading branch information
David Monllao committed Nov 2, 2016
2 parents a35dea7 + 26d38b0 commit cdacdf7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mod/quiz/renderer.php
Expand Up @@ -490,7 +490,8 @@ public function attempt_form($attemptobj, $page, $slots, $id, $nextpage) {
$attemptobj->attempt_url($slot, $page), $this);
}

$output .= $this->attempt_navigation_buttons($page, $attemptobj->is_last_page($page));
$navmethod = $attemptobj->get_quiz()->navmethod;
$output .= $this->attempt_navigation_buttons($page, $attemptobj->is_last_page($page), $navmethod);

// Some hidden fields to trach what is going on.
$output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'attempt',
Expand Down Expand Up @@ -526,13 +527,14 @@ public function attempt_form($attemptobj, $page, $slots, $id, $nextpage) {
*
* @param int $page the page number. Starts at 0 for the first page.
* @param bool $lastpage is this the last page in the quiz?
* @param string $navmethod Optional quiz attribute, 'free' (default) or 'sequential'
* @return string HTML fragment.
*/
protected function attempt_navigation_buttons($page, $lastpage) {
protected function attempt_navigation_buttons($page, $lastpage, $navmethod = 'free') {
$output = '';

$output .= html_writer::start_tag('div', array('class' => 'submitbtns'));
if ($page > 0) {
if ($page > 0 && $navmethod == 'free') {
$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'previous',
'value' => get_string('navigateprevious', 'quiz'), 'class' => 'mod_quiz-prev-nav'));
}
Expand Down

0 comments on commit cdacdf7

Please sign in to comment.