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

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

    XMLWordPrintable

Details

    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • 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.

    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()

      Attachments

        Activity

          People

            timhunt Tim Hunt
            timhunt Tim Hunt
            Sam Marshall Sam Marshall
            Aparup Banerjee Aparup Banerjee
            Michael de Raadt Michael de Raadt
            Sam Marshall, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              9/Jan/12