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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.2.7, 2.3.4, 2.4.1
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/Jan/13