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

Non-descript database error when question answer is too long

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.3.7, 2.4.4
    • 2.3.3
    • Questions
    • MOODLE_23_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • 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.)

      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.

            timhunt Tim Hunt
            dhempy David Hempy
            Damyon Wiese Damyon Wiese
            Damyon Wiese Damyon Wiese
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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