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.