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

show Quiz Submit button on the last page only

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • 1.9.8
    • 1.9
    • Quiz
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE
    • Easy

      when teachers split a quiz to several pages... some times, the pupils
      get confused and press the submit button on the bottom of the page
      instead of pressing the Next link for the quiz' next page.

      so, i made a little hack to have the Submit button appears only on the
      last page in the sequence.

      open moodle/mod/quiz/attempt.php and wrap the following lines (around line 506)
      echo "<div class=\"submitbtns mdl-align\">\n";
      echo "<input type=\"submit\" name=\"saveattempt\" value=\"".get_string("savenosubmit", "quiz")."\" />\n";
      if ($quiz->optionflags & QUESTION_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";

      echo "</div>";

      like this:

      if ($numpages == $page+1) { // show submit button on last page only

      echo "<div class=\"submitbtns mdl-align\">\n";
      echo "<input type=\"submit\" name=\"saveattempt\" value=\"".get_string("savenosubmit", "quiz")."\" />\n";
      if ($quiz->optionflags & QUESTION_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";

      echo "</div>";
      }

      i guess, we can add a global $CFG to control this behavior
      or even a local new setting in each quiz module (DB table)
      if others will like this feature too.

      enjoy

            timhunt Tim Hunt
            nadavkav Nadav Kavalerchik
            Nobody Nobody
            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.