Overflow of links in quiz

Overflow of links in quiz

Nosūtīja Pieter Wolters
Atbilžu skaits: 2
Hi

I want to make some test with a lot of questions and if possible one question per page. Number of questions : some 70.

However when somebody takes this quiz the links to the pages overflow in the browser as you see in the picture below. I don't want to bother my candidates with this kind of behaviour. Is there something I can do about this behaviour of Moodle?

In a way that you see only screen wide pages. Closed with the link "(next)", for example?

Link overflow in quiz taking
Vidējais novērtējums: -
Atbildot uz Pieter Wolters

Re: Overflow of links in quiz

Nosūtīja Pieter Wolters
Hi ,

I got no replies but I still hope somebody can help me!

I used Moodle 1.9.5 and 1.9.9

Gr Pieter
Atbildot uz Pieter Wolters

Re: Overflow of links in quiz

Nosūtīja Joseph Rézeau
Core developers attēls Particularly helpful Moodlers attēls Plugin developers attēls Testers attēls Translators attēls

Good question! Apparently when the Quiz interface was created it was never envisaged that a quiz might contain such a large number of question pages that the paging bar would overflow the window to the right.

There is a very easy fix, if you are ready to hack your core Moodle file.

In latest Moodle 1.9.9 version go to file moodle/mod/quiz/locallib.php, locate the function quiz_print_navigation_panel($page, $pages).

Around lines 240 etc. in the following loop, replace all   (non-breaking spaces) with a "normal" space.

for ($i = 0; $i < $pages; $i++) {
if ($i == $page) {
echo '&nbsp;<span class="thispage">'.($i+1).'</span>&nbsp;';
} else {
echo '&nbsp;<a href="javascript:navigate(' . ($i) . ');">'.($i+1).'</a>&nbsp;';
}
}

becomes:

for ($i = 0; $i < $pages; $i++) {
if ($i == $page) {
echo ' <span class="thispage">'.($i+1).'</span> ';
} else {
echo ' <a href="javascript:navigate(' . ($i) . ');">'.($i+1).'</a> ';
}
}

@Tim : why not make this a permanent fix in 1.9?

See attached screenshot

Joseph

Pielikums image00.jpg