Moodle

Make page-jumping in multi-page-quizzes an option

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Won't Fix
  • Affects Version/s: 1.5.2
  • Fix Version/s: None
  • Component/s: Quiz
  • Labels:
    None
  • Environment:
    Linux
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_15_STABLE

Description

This patch needs the patches from MDL-3850 and MDL-3881

The help file could be more detailed

diff -uNr moodle2/lang/en/help/quiz/pagejumping.html moodle/lang/en/help/quiz/pagejumping.html

— moodle2/lang/en/help/quiz/pagejumping.html 1970-01-01 01:00:00.000000000 +0100

+++ moodle/lang/en/help/quiz/pagejumping.html 2005-08-11 05:06:58.000000000 +0200

@@ -0,0 +1,4 @@

+<p align=center><b>Allow jumping between pages</b></p>

+

+<p>This allow jumping forward/backward in multi-page quizzes.

+</p>

diff -uNr moodle2/lang/en/quiz.php moodle/lang/en/quiz.php

— moodle2/lang/en/quiz.php 2005-07-15 21:44:41.000000000 +0200

+++ moodle/lang/en/quiz.php 2005-08-11 05:05:00.000000000 +0200

@@ -263,6 +263,7 @@

$string['optional'] = 'optional';

$string['outof'] = ' out of a maximum of ';

$string['overdue'] = 'Overdue';

+$string['pagejumping'] = 'Allow jumping between pages';

$string['paragraphquestion'] = 'Paragraph Question not supported at line $a. The question will be ignored';

$string['parent'] = 'Parent';

$string['partiallycorrect'] = 'Partially correct';

diff -uNr moodle2/mod/quiz/attempt.php moodle/mod/quiz/attempt.php

— moodle2/mod/quiz/attempt.php 2005-08-10 04:15:48.000000000 +0200

+++ moodle/mod/quiz/attempt.php 2005-08-09 04:21:48.000000000 +0200

@@ -425,7 +425,14 @@

</script>

<?php

echo '<input type=hidden id=page name=page value='.$page.\ />\n;

  • quiz_print_navigation_panel($page, $numpages);

+ if ($quiz->optionflags & QUIZ_PAGEJUMPING) { + quiz_print_navigation_panel($page, $numpages); + + } else if ($page < $numpages - 1) { + $strnext = get_string('next'); + echo '<div class=pagingbar><input type=button name='.$strnext. + ' value='.$strnext.' onClick=navigate('.($page + 1).')></div>'; + }

echo <br />\n;

}



@@ -457,7 +457,9 @@

if ($quiz->optionflags & QUIZ_ADAPTIVE) { echo <input type=\submit\ name=\markall\ value=\.get_string(markall, quiz).\ />\n; }

- echo <input type=\submit\ name=\finishattempt\ value=\.get_string(finishattempt, quiz).\ onclick=\$onclick\ />\n;

+ if ($quiz->optionflags & QUIZ_PAGEJUMPING // $page == ($numpages -1)) { + echo <input type=\submit\ name=\finishattempt\ value=\.get_string(finishattempt, quiz).\ onclick=\$onclick\ />\n; + }

echo '<input type=hidden name=timeup value=0 />';



echo </center>;

@@ -465,7 +465,14 @@

// Print the navigation panel if required

if ($numpages > 1) {

echo <br />\n;

- quiz_print_navigation_panel($page, $numpages);

+ if ($quiz->optionflags & QUIZ_PAGEJUMPING) { + quiz_print_navigation_panel($page, $numpages); + + } } else if ($page < $numpages - 1) { + $strnext = get_string('next'); + echo '<div class=pagingbar><input type=button name='.$strnext. + ' value='.$strnext.' onClick=navigate('.($page + 1).')></div>'; + }

echo '<br />';

}

diff -uNr moodle2/mod/quiz/config.html moodle/mod/quiz/config.html

— moodle2/mod/quiz/config.html 2005-08-10 04:28:35.000000000 +0200

+++ moodle/mod/quiz/config.html 2005-08-06 06:26:34.000000000 +0200

@@ -128,6 +128,20 @@

</tr>

<tr valign=top>

+ <td align=right><b><?php print_string(pagejumping, quiz) ?>:</b></td>

+ <td>

+ <?php

+ choose_from_menu ($yesnooptions, pagejumping, (($CFG->quiz_optionflags & QUIZ_PAGEJUMPING) ? 1 : 0), );

+ helpbutton(pagejumping, get_string(pagejumping, quiz), quiz);

+ ?>

+ </td>

+ <td align=center>

+ <input type=hidden name=fix_pagejumping value=0 />

+ <input type=checkbox name=fix_pagejumping value=1 <?php p($CFG->quiz_fix_pagejumping ? checked : ) ?> />

+ </td>

+</tr>

+

+<tr valign=top>

<td align=right><b><?php print_string(shufflequestions, quiz) ?>:</b></td>

<td>

<?php

diff -uNr moodle2/mod/quiz/defaults.php moodle/mod/quiz/defaults.php

— moodle2/mod/quiz/defaults.php 2005-08-10 04:28:35.000000000 +0200

+++ moodle/mod/quiz/defaults.php 2005-08-06 07:13:26.000000000 +0200

@@ -17,9 +17,10 @@

'quiz_shufflequestions' => 0,

'quiz_subnet' => '',

'quiz_timelimit' => 0,

  • 'quiz_optionflags' => QUIZ_ADAPTIVE,

+ 'quiz_optionflags' => QUIZ_ADAPTIVE / QUIZ_PAGEJUMPING,

'quiz_penaltyscheme' => 1,

'quiz_adaptive' => 1,

+ 'quiz_pagejumping' => 1,

'quiz_fix_review' => 0,

'quiz_fix_attemptonlast' => 0,

@@ -34,7 +34,8 @@

'quiz_fix_subnet' => 0,

'quiz_fix_timelimit' => 0,

'quiz_fix_adaptive' => 0,

  • 'quiz_fix_penaltyscheme' => 0

+ 'quiz_fix_penaltyscheme' => 0,

+ 'quiz_fix_pagejumping' => 0

);

?>

diff -uNr moodle2/mod/quiz/lib.php moodle/mod/quiz/lib.php

— moodle2/mod/quiz/lib.php 2005-08-10 04:28:35.000000000 +0200

+++ moodle/mod/quiz/lib.php 2005-08-06 06:26:34.000000000 +0200

@@ -29,6 +29,11 @@

*/

define('QUIZ_IGNORE_DUPRESP', 2);

+/**

+* Enable Jumping between Pages

+*/

+define('QUIZ_PAGEJUMPING', 4);

+

/*#@-/

/**

@@ -682,6 +692,10 @@

$optionflags /= QUIZ_ADAPTIVE;

}

+ if (!empty($form->pagejumping)) { + $optionflags /= QUIZ_PAGEJUMPING; + }

+

if (isset($form->responsesimmediately)) { $review += (QUIZ_REVIEW_RESPONSES & QUIZ_REVIEW_IMMEDIATELY); unset($form->responsesimmediately); diff -uNr moodle2/mod/quiz/mod.html moodle/mod/quiz/mod.html --- moodle2/mod/quiz/mod.html 2005-08-10 04:28:35.000000000 +0200 +++ moodle/mod/quiz/mod.html 2005-08-06 06:26:34.000000000 +0200 @@ -175,6 +175,18 @@ </tr> <?php } else $fix=1 ?>

+<?php if (!$CFG->quiz_fix_pagejumping) { ?> + <tr valign=top> + <td align=right><b><?php print_string(pagejumping, quiz) ?>:</b></td> + <td align=left> + <?php + choose_from_menu($yesnooptions, pagejumping, (($form->optionflags & QUIZ_PAGEJUMPING) ? 1 : 0), ); + helpbutton(pagejumping, get_string(pagejumping,quiz), quiz); + ?> + </td> + </tr> +<?php } else $fix=1 ?>

+

<?php if (!$CFG->quiz_fix_shufflequestions) { ?> <tr valign=top> <td align=right><b><?php print_string(shufflequestions, quiz) ?>:</b></td> @@ -402,6 +426,18 @@ </tr> <?php } ?>

+<?php if ($CFG->quiz_fix_pagejumping) { $fix = 1; ?> + <tr valign=top> + <td align=right><b><?php print_string(pagejumping, quiz) ?>:</b></td> + <td align=left> + <?php + choose_from_menu($yesnooptions, pagejumping, (($form->optionflags & QUIZ_PAGEJUMPING) ? 1 : 0), ); + helpbutton(pagejumping, get_string(pagejumping,quiz), quiz); + ?> + </td> + </tr> +<?php } ?>

+

<?php if ($CFG->quiz_fix_shufflequestions) { ?>

<tr valign=top>

<td align=right><b><?php print_string(shufflequestions, quiz) ?>:</b></td>

Issue Links

Activity

Hide
Martin Dougiamas added a comment -

From Gustav Delius (gwd2 at york.ac.uk) Saturday, 27 August 2005, 03:28 AM:

Can you please explain the purpose of this patch a bit more and exactly what it does? Perhaps there is already a forum post about it?

From Olaf Rempel (razzor at kopf-tisch.de) Tuesday, 30 August 2005, 05:53 AM:

With this patch, the navbar for quizpages (page 1 2 3 4 ...) will be an per quiz config option.

So one can build a quiz where it is not possible to jump between questions (think of one question per page).

From Gustav Delius (gwd2 at york.ac.uk) Tuesday, 30 August 2005, 06:23 AM:

What happens when they revisit the attempt. Will they start at page 1 again or on the page they were last on? I guess it will have to be the later because otherwise they could still navigate between pages, it would only be more tedious. If you do have a mechanism for letting them continue on the page they were last on then that will be useful in general.

From Olaf Rempel (razzor at kopf-tisch.de) Wednesday, 31 August 2005, 02:53 AM:

> What happens when they revisit the attempt. Will they start at page 1 again or on the page they were last on?

Unfortunately they start on page 1 again.

So this fix is not complete and I was not able to find a solution for this

From Gustav Delius (gwd2 at york.ac.uk) Monday, 13 February 2006, 04:21 AM:

Because of the problem that new attempts always start on page 1 again I don't think this will ever make it into the core distribution. I am therefore closing this feature request.

Show
Martin Dougiamas added a comment - From Gustav Delius (gwd2 at york.ac.uk) Saturday, 27 August 2005, 03:28 AM: Can you please explain the purpose of this patch a bit more and exactly what it does? Perhaps there is already a forum post about it? From Olaf Rempel (razzor at kopf-tisch.de) Tuesday, 30 August 2005, 05:53 AM: With this patch, the navbar for quizpages (page 1 2 3 4 ...) will be an per quiz config option. So one can build a quiz where it is not possible to jump between questions (think of one question per page). From Gustav Delius (gwd2 at york.ac.uk) Tuesday, 30 August 2005, 06:23 AM: What happens when they revisit the attempt. Will they start at page 1 again or on the page they were last on? I guess it will have to be the later because otherwise they could still navigate between pages, it would only be more tedious. If you do have a mechanism for letting them continue on the page they were last on then that will be useful in general. From Olaf Rempel (razzor at kopf-tisch.de) Wednesday, 31 August 2005, 02:53 AM: > What happens when they revisit the attempt. Will they start at page 1 again or on the page they were last on? Unfortunately they start on page 1 again. So this fix is not complete and I was not able to find a solution for this From Gustav Delius (gwd2 at york.ac.uk) Monday, 13 February 2006, 04:21 AM: Because of the problem that new attempts always start on page 1 again I don't think this will ever make it into the core distribution. I am therefore closing this feature request.
Hide
Michael Blake added a comment -

assign to a valid user

Show
Michael Blake added a comment - assign to a valid user

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: