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

Conditional availablility does not restrict min and max grades to be numbers.

    Details

    • Testing Instructions:
      Hide

      Turn on conditional availability and activity completion for your Moodle.

      Edit an activity and make sure that all the following trigger the right validation messages:

      1. Min not a number
      2. Max not a number
      3. Min > Max
      4. Min and/or max set, but no grade item selected.
      5. Grade item selected, but neither min nor max given.

      Check that the following valid combinations are accepted

      A. grade item, and both min < max input
      B. grade item with only min input.
      C. grade item with only max input.

      Show
      Turn on conditional availability and activity completion for your Moodle. Edit an activity and make sure that all the following trigger the right validation messages: 1. Min not a number 2. Max not a number 3. Min > Max 4. Min and/or max set, but no grade item selected. 5. Grade item selected, but neither min nor max given. Check that the following valid combinations are accepted A. grade item, and both min < max input B. grade item with only min input. C. grade item with only max input.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Try to make one activity only available when the grade on another activity is between 'frog' and 'toad'. You will get an error like

      Error writing to database
       
      More information about this error
      Debug info: ERROR: invalid input syntax for type numeric: "frog"
      INSERT INTO mdl_course_modules_availability (coursemoduleid,gradeitemid,grademin,grademax) VALUES
      [array (
      'coursemoduleid' => '20828',
      'gradeitemid' => '27',
      'grademin' => 'frog',
      'grademax' => 'toad',
      )]
      Stack trace:
       
      line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
          line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
          line 792 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
          line 844 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
          line 249 of /lib/conditionlib.php: call to pgsql_native_moodle_database->insert_record()
          line 653 of /lib/conditionlib.php: call to condition_info->add_grade_condition()
          line 319 of /course/modedit.php: call to condition_info::update_cm_from_form()

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jan/12