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

Quiz settings validation does not trap plain text error in Grade boundary field

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4
    • 2.2.7, 2.3.4, 2.4.1
    • Quiz
    • MOODLE_24_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Hide

      1.- In a moodle 2.4 installation, create a new Quiz or (Edit an existing one).
      2.- On the Settings page, go down to the Overall feedback section.
      3.- In the Grade boundary 100% Feedback field enter some feedback text.
      4.- In the next Grade boundary box, instead of entering a number, enter a word, e.g. "good".
      5.- Now go down to the bottom of the Quiz Settings page and click the Save and display button.
      6.- Check that the quiz settings are not saved and you are returned to the Editing page.
      7.- On the Settings page, go down to the Overall feedback section and check that you can see the error message above the second feedback boundary box: Feedback grade boundaries must be either a percentage or a number. The value you entered in boundary 1 is not recognised.

      Show
      1.- In a moodle 2.4 installation, create a new Quiz or (Edit an existing one). 2.- On the Settings page, go down to the Overall feedback section. 3.- In the Grade boundary 100% Feedback field enter some feedback text. 4.- In the next Grade boundary box, instead of entering a number, enter a word, e.g. "good". 5.- Now go down to the bottom of the Quiz Settings page and click the Save and display button. 6.- Check that the quiz settings are not saved and you are returned to the Editing page. 7.- On the Settings page, go down to the Overall feedback section and check that you can see the error message above the second feedback boundary box: Feedback grade boundaries must be either a percentage or a number. The value you entered in boundary 1 is not recognised.

    Description

      Quiz settings validation correctly detects a non-numeric value followed by the % sign, but it fails to detect a non-numeric value (i.e. plain text).
      I am attaching a simple patch, which does work but is maybe not the most elegant solution.
      Only tested on current 2.4 version but I expect the bug exists in previous Moodle 2 versions.

      Attachments

        Activity

          People

            rezeau Joseph Rézeau
            rezeau Joseph Rézeau
            Tim Hunt Tim Hunt
            Dan Poltawski Dan Poltawski
            Adrian Greeve Adrian Greeve
            Tim Hunt, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              14/Jan/13