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

Cannot enter an answer of zero in a multiple choice question

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 2.2.6, 2.3.3
    • 2.2.5
    • Questions
    • None
    • MOODLE_22_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • Hide

      1. Turn on the HTML editor in your user profile. (After that you have done that, you will have to log out and log in again for it to take effect. That is probably a bug, but an unrelated one.)

      2. Go to the question bank, and create a multiple choice question with choices 1, 0 and -1, with 0 the right choice. Make sure you can save the form.

      Show
      1. Turn on the HTML editor in your user profile. (After that you have done that, you will have to log out and log in again for it to take effect. That is probably a bug, but an unrelated one.) 2. Go to the question bank, and create a multiple choice question with choices 1, 0 and -1, with 0 the right choice. Make sure you can save the form.

    Description

      If you try to use the number 0 as an answer in a multiple-choice question, Moodle will not accept it. Looks like misuse of a comparison operator in the code.

      Steps to reproduce
      ==================
      1. Create a new multiple-choice question. Give it a name and question text.
      2. Insert answers: 2, 1, 0, -1
      3. Insert 100% grade for one of them
      4. Save changes

      Expected result
      ===============
      Question should be created successfully.

      Actual result
      =============
      Moodle returns to the form, and the answer 0 has an error message: "Grade set, but the Answer is blank"

      Attachments

        Activity

          People

            timhunt Tim Hunt
            daveyboond Steve Bond
            Sam Hemelryk Sam Hemelryk
            Ankit Agarwal Ankit Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Clockify

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