Moodle
  1. Moodle
  2. MDL-35419

Manual grading validation does not work with comma as a decimal separator

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.5, 2.3.2, 2.4
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      You need to test in both English and French (for example, basically one lang where they say 0.5 and on where they say 0,5).

      You need to test both manual grading using the 'Make comment or override grade' link when reviewing a quiz attempt, and manual grading using Quiz -> Results -> Manual grading.

      You need to test

      • Valid grades are accepted.
      • Leaving the box blank does not set a grade. (If it was buggy, it might set the grade to 0.)
      • That you get a validation message if the number you type is out of range too high or too low.
      Show
      You need to test in both English and French (for example, basically one lang where they say 0.5 and on where they say 0,5). You need to test both manual grading using the 'Make comment or override grade' link when reviewing a quiz attempt, and manual grading using Quiz -> Results -> Manual grading. You need to test Valid grades are accepted. Leaving the box blank does not set a grade. (If it was buggy, it might set the grade to 0.) That you get a validation message if the number you type is out of range too high or too low.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      44098

      Description

      The code in is_manual_grade_in_range in question/behaviour/behaviourbase.php uses optional_param(... PARAM_FLOAT) which does not cope with numbers like 0,50. It should be using code like the PARAM_MARK case of get_submitted_var in question/engine/questionattempt.php

      Note that, because of the nature of this bug, the symptoms are very mild, I think that the worst that could happen in that if a teacher types 1,5 into the manual grade box for a question with maximum grade 1, then they will see a low-level DB exception, rather than a nice validation error in the UI.

        Activity

        Hide
        Tim Hunt added a comment -

        Submitting a fix for integration.

        Show
        Tim Hunt added a comment - Submitting a fix for integration.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Integrated (22, 23 & master), thanks!

        Show
        Eloy Lafuente (stronk7) added a comment - Integrated (22, 23 & master), thanks!
        Hide
        Jason Fowler added a comment -

        Works fine Tim

        Show
        Jason Fowler added a comment - Works fine Tim
        Hide
        Dan Poltawski added a comment -

        Congratulations, you've done it!

        Thanks, this change is now in the latest weekly release!

        Join the crowds of people tomorrow from 8am and download this Moodle release from your local apple store!

        Show
        Dan Poltawski added a comment - Congratulations, you've done it! Thanks, this change is now in the latest weekly release! Join the crowds of people tomorrow from 8am and download this Moodle release from your local apple store!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: