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

Error in Quiz Re-Attempts: "Could not insert entry in question_sessions"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.2
    • Fix Version/s: 1.8.8, 1.9.4
    • Component/s: Questions
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      Background: We have set up a number of exercises in a course using the Quiz tool to serve as drills that students can keep redoing until they get all the questions right. These quizzes are set to unlimited attempts, each attempts building on the last, adaptive mode off. The questions are all short answer.

      Problem: Upon submission all answers are evaluated and graded successfully, but when a student goes to "Re-attempt quiz", he or she gets an error "Could not insert entry in question_sessions". The re-attempt is in fact started, and the first few answer fields are filled in, but from a certain point on all of the answers are blank and must be manually re-inserted by the student.

      Cause: By trial and error I was able to figure out that the issue is being triggered by the existence of quotation marks (' or ") in some of the answers. When the first such question is encountered, the error is generated and no more answers are inserted in the re-attempt. (The error may not be limited to quotation marks, but those are the characters that I have been able to verify. Question marks do not produce the error.)

      History: We are currently using Moodle 1.9.2 (Build: 20080711). We never encountered the problem last year under version 1.8, and a test on our archive server where 1.8 still resides confirms that it is not an issue in that version. We upgraded to 1.9 over the summer and now the problem is showing up. I'm not positive whether it is the version or some configuration that got changed in the upgrade.

        Attachments

          Activity

            People

            • Assignee:
              timhunt Tim Hunt
              Reporter:
              randallitc Randall Gordon
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                28/Jan/09