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

Grade condition mark range validation allows for impossible conditions

XMLWordPrintable

    • MOODLE_23_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MDL-36412-master
    • Hide

      (On a course, where availability is enabled.)

      1. Select to add a Label. In the form, type the label text.
      2. Under 'Grade condition', select 'Course total' must be at least 50% and less than 50%.
      3. Save changes.
      - A suitable error should be displayed next to the field.
      4. Change so it must be at least 50% and less than 51%.
      5. Save changes.
      - The creation should go through OK.
      6. Edit settings for a section on the course.
      7. Set a grade condition on course total for at least 50% and less than 50%.
      8. Save changes.
      - An error should be displayed.
      9. Change it to less than 51%.
      10. Save changes.
      - The edit should go through.

      Show
      (On a course, where availability is enabled.) 1. Select to add a Label. In the form, type the label text. 2. Under 'Grade condition', select 'Course total' must be at least 50% and less than 50%. 3. Save changes. - A suitable error should be displayed next to the field. 4. Change so it must be at least 50% and less than 51%. 5. Save changes. - The creation should go through OK. 6. Edit settings for a section on the course. 7. Set a grade condition on course total for at least 50% and less than 50%. 8. Save changes. - An error should be displayed. 9. Change it to less than 51%. 10. Save changes. - The edit should go through.

      I noted that, when adding a grade condition in conditional activities, it is possible to:

      • set percentage values less than 0%
      • set percentage values greater than 100%
      • set the "must be at least" value to be the same as the "and less than" value.

      The first two of these two possibilities are possibly acceptable under some unusual circumstances. Certainly, if the values were constrained to be between 0 and 100%, someone would come up with a case where this is not appropriate.

      For the final possibility, this is a boundary condition. I couldn't find the place where this is actually evaluated in code, but from reading the labels, if the two values are the same, it seems that you could create a condition that a student could never meet. If I am wrong, please correct me, but if not, the validation should probably change so that it does not allow this impossible range.

            quen Sam Marshall
            salvetore Michael de Raadt
            Sam Hemelryk Sam Hemelryk
            Dan Poltawski Dan Poltawski
            Michael de Raadt Michael de Raadt
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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