Closed (fixed)
Project:
Quiz
Version:
7.x-5.x-dev
Component:
Code - Quiz core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2012 at 22:34 UTC
Updated:
23 Mar 2012 at 12:27 UTC
The error returned being:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
To duplicate the error you need more than 10 questions in they system to choose from, I have 40.
1. select the first 10 questions
2. Click save
SUCCESS
3. select the next lot of 10 questions
4. Click save
FAILED
To be able to add all 40 questions to the quiz I edited the query limit from 10 to 50 on line 1341 in quiz.module.
It seems that on every save action it is attempting to re-add the same questions rather than just the ones you have added since the last save (the ones with the * next to them)
Hope this helps.
Comments
Comment #1
Ibesan commentedSame here.
Comment #2
Sabareesh commentedHi i found a way in which this error can be avoided. 'quiz_update_quiz_question_relationship' function in quiz.module has a query which according to me has no special purpose.
So i thought of commenting the Execute(); in the function. After commenting the execute function i saw the correct behavior in quiz module.
I am not sure whether this is the correct way to find a solution, but still it saved me some good time.
I have shared a piece of code that i changed in this function.
Comment #3
Ibesan commentedWorks fine, thank you ;)
Comment #4
Sabareesh commentedComment #5
catproject commentedthanxxxx a lottt..... your way saved me ... :) thanx a lot man ... u are a true saviour ..:)
Comment #6
nahomadis commentedI would like to extend my thanks to Sabareesh.KF for that suggestion. I've spent some time trying to get it to work and your suggestion worked perfectly.
Thank you.