Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-3892

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

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Trivial Trivial
    • None
    • 1.5.2
    • Quiz
    • None
    • Linux
    • MySQL
    • MOODLE_15_STABLE

      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>

            timhunt Tim Hunt
            imported Imported (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.