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

Non-descript database error when question answer is too long

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.3
    • Fix Version/s: 2.3.7, 2.4.4
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      1. Try to create a matching question whith an answer that is longer than 255 characters. You should not be able to type more than 255 characters into the answer box.

      2. Check that a question with exactly 255 unicode chars in the answer will save. (Hint: 一二三四五六七八九十 is 1 - 10 in Japanese. Copy that 25 and a half times.)

      Show
      1. Try to create a matching question whith an answer that is longer than 255 characters. You should not be able to type more than 255 characters into the answer box. 2. Check that a question with exactly 255 unicode chars in the answer will save. (Hint: 一二三四五六七八九十 is 1 - 10 in Japanese. Copy that 25 and a half times.)
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      When creating a matching question, supplying an answer over 255 characters results in the non-descriptive error message, "Error writing to database. More information about this error."

      It would be much better if the response had one or more of these responses: name the field ("Answer 1"), more detailed error ("input is too long for field (255 character limit)"), return the browser to the input form with that field highlighted, etc.

      Ideally, this would be implemented as part of Moodle's libraries (not specific to the question import routine), so it would benefit all forms.

      A complimentary approach would be to validate the input before submitting or during data entry.

      I searched for similar trackers and found some about fields too long, but none for questions in particular, and none that seemed general enough (just from the title, at least) to cover the issue globally. This is the first tracker I've filed, so please let me know if I've missed anything.

      We are running 2.3.2+ with MySQL on Ubuntu.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/May/13