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

Error, questionsummary too big, mod/quiz upgrade from 2.0.6 to 2.2+ (Build: 20111209)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.1.4, 2.2.1
    • Component/s: Quiz
    • Labels:
      None
    • Environment:
      Linux server, Apache,
    • Database:
      MySQL
    • Testing Instructions:
      Hide

      This needs to be tested on MySQL. Ideally on all supported databases, but that is probably too much to ask.

      1. Import the question in the attached .xml file into a 2.0 site.
      2. Add that question to a quiz.
      3. Attempt the quiz as a student.
      4. Try upgrading the site to Moodle 2.1 or 2.2. Make sure there are no errors.

      5. Import the attached question to a 2.1 or 2.2 site.
      6. Try to preview the question. Make sure there are no errors.

      Show
      This needs to be tested on MySQL. Ideally on all supported databases, but that is probably too much to ask. 1. Import the question in the attached .xml file into a 2.0 site. 2. Add that question to a quiz. 3. Attempt the quiz as a student. 4. Try upgrading the site to Moodle 2.1 or 2.2. Make sure there are no errors. 5. Import the attached question to a 2.1 or 2.2 site. 6. Try to preview the question. Make sure there are no errors.
    • Workaround:
      Hide

      Updated question/engine/upgrade/upgradelib.php
      line 248 by adding

      if (isset($qa->questionsummary) && (strlen($qa->questionsummary) > 65535))

      { $qa->questionsummary = substr($qa->questionsummary, 0, 65534); }
      Show
      Updated question/engine/upgrade/upgradelib.php line 248 by adding if (isset($qa->questionsummary) && (strlen($qa->questionsummary) > 65535)) { $qa->questionsummary = substr($qa->questionsummary, 0, 65534); }
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      When I upgrade our Clone from 2.0.6 to 2.2+ (after a previous update from 1.9.10 to 2.0.6), I
      get the following error:
      ---------------------
      Debug info: Data too long for column 'questionsummary' at row 1
      INSERT INTO moquestion_attempts (questionid,variant,behaviour,questionsummary,rightanswer,maxmark,minfraction,flagged,responsesummary,timemodified,questionusageid,slot) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)
      -------------------
      The complete output is attached. Apparently, the questionsummary created is too large.
      The upgrade script should check whether the string is to large and cut it to the maximum size
      of the questionsummary field (type text) when necessary.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

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