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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.2.7, 2.3.4, 2.4.1
    • 2.4
    • 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.

      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.

            rezeau Joseph Rézeau
            rezeau Joseph Rézeau
            Tim Hunt Tim Hunt
            Dan Poltawski Dan Poltawski
            Adrian Greeve Adrian Greeve
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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