diff -Naur htdocs.orig/lang/en_utf8/quiz.php htdocs/lang/en_utf8/quiz.php --- htdocs.orig/lang/en_utf8/quiz.php 2010-08-24 15:48:04.807497734 -0400 +++ htdocs/lang/en_utf8/quiz.php 2010-08-24 15:45:41.200490796 -0400 @@ -517,6 +517,7 @@ $string['savegrades'] = 'Save grades'; $string['savemyanswers'] = 'Save my answers'; $string['savenosubmit'] = 'Save without submitting'; +$string['nextpage'] = 'Next Page'; $string['savequiz'] = 'Save this whole quiz'; $string['score'] = 'Raw score'; $string['scores'] = 'Scores'; diff -Naur htdocs.orig/mod/quiz/attempt.php htdocs/mod/quiz/attempt.php --- htdocs.orig/mod/quiz/attempt.php 2010-08-24 14:55:07.297497508 -0400 +++ htdocs/mod/quiz/attempt.php 2010-08-24 17:07:06.155497518 -0400 @@ -221,6 +221,12 @@ /// Load all the questions and states needed by this script + if ($responses = data_submitted() and empty($responses->quizpassword)) { + if ($responses->nextpage) { + $page++ ; + } + } + // list of questions needed by page $pagelist = quiz_questions_on_page($attempt->layout, $page); @@ -292,7 +298,7 @@ unset($responses->newpage); unset($responses->review); unset($responses->questionids); - unset($responses->saveattempt); // responses get saved anway + unset($responses->nextpage); unset($responses->finishattempt); // same as $finishattempt unset($responses->markall); unset($responses->forcenewattempt); @@ -485,10 +491,10 @@ } echo '
'; -/// Print the navigation panel if required +/// Print the page number panel if required $numpages = quiz_number_of_pages($attempt->layout); if ($numpages > 1) { - quiz_print_navigation_panel($page, $numpages); + quiz_print_page_number($page, $numpages); } /// Print all the questions @@ -506,17 +512,23 @@ $onclick = "return confirm('$strconfirmattempt')"; echo "
\n"; - echo "\n"; +echo "PAGE: $page+1
\n" ; +echo "PAGE: $numpages
\n" ; + if ( $page+1 < $numpages ) { + echo "\n"; + } if ($quiz->optionflags & QUESTION_ADAPTIVE) { echo "\n"; } - echo "\n"; + if ( $page+1 >= $numpages ) { + echo "\n"; + } echo "
"; - // Print the navigation panel if required + // Print the page number panel if required if ($numpages > 1) { - quiz_print_navigation_panel($page, $numpages); + quiz_print_page_number($page, $numpages); } // Finish the form diff -Naur htdocs.orig/mod/quiz/locallib.php htdocs/mod/quiz/locallib.php --- htdocs.orig/mod/quiz/locallib.php 2009-09-30 20:06:15.000000000 -0400 +++ htdocs/mod/quiz/locallib.php 2010-08-24 17:00:33.308497489 -0400 @@ -255,6 +255,26 @@ echo '
'; } +/** + * Print current page of all quiz pages + * + * @param integer $page The number of the current page (counting from 0). + * @param integer $pages The total number of pages. + */ +function quiz_print_page_number($page, $pages) { + echo '
'; + echo '' . get_string('page') . ': '; + for ($i = 0; $i < $pages; $i++) { + if ($i == $page) { + echo ' '.($i+1).' '; + } else { + echo ' '.($i+1).' '; + } + } + echo '
'; +} + + /// Functions to do with quiz grades ////////////////////////////////////////// /** @@ -932,4 +952,4 @@ return strpos($_SERVER['HTTP_USER_AGENT'], "SEB") !== false; } -?> \ No newline at end of file +?>