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

show Quiz Submit button on the last page only

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.8
    • Component/s: Quiz
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      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

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            nadavkav Nadav Kavalerchik
            Tester:
            Nobody
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              25/Mar/10