I set the pass fail rate for quizzes (from the main configuration menu) and when I tried to change the settings, I got this error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY': INSERT INTO {quiz_user_settings} (uid, nid, vid, aid, pass_rate, summary_pass, summary_pass_format, summary_default, summary_default_format, randomization, backwards_navigation, keep_results, repeat_until_correct, feedback_time, display_feedback, takes, show_attempt_stats, time_limit, quiz_always, has_userpoints, allow_skipping, allow_resume, allow_jumping, show_passed) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18, :db_insert_placeholder_19, :db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => 80 [:db_insert_placeholder_5] =>
Good job!
[:db_insert_placeholder_6] => plain_text [:db_insert_placeholder_7] => You need a little review on this lesson. Then try the quiz again! [:db_insert_placeholder_8] => filtered_html [:db_insert_placeholder_9] => 0 [:db_insert_placeholder_10] => 1 [:db_insert_placeholder_11] => 2 [:db_insert_placeholder_12] => 0 [:db_insert_placeholder_13] => 0 [:db_insert_placeholder_14] => 1 [:db_insert_placeholder_15] => 0 [:db_insert_placeholder_16] => 1 [:db_insert_placeholder_17] => 0 [:db_insert_placeholder_18] => 1 [:db_insert_placeholder_19] => 0 [:db_insert_placeholder_20] => 1 [:db_insert_placeholder_21] => 1 [:db_insert_placeholder_22] => 0 [:db_insert_placeholder_23] => 1 ) in _quiz_save_user_settings() (line 4159 of /home/vsource4/www/www/sites/all/modules/quiz/quiz.module).
It looks like it wants to save a few configuration rather than update the prior one. I'm going to look at the code but don't trust my skills enough to think that I can fix it.
Thanks in advance for any help or insights!
Comments
Comment #1
hhschoone commentedI get the same error here. It isn't thrown on a clean D 7.17.1 installation, but nevertheless persists when deactivating almost all modules on an existing D7.17 installation. Anyone any idea?
Comment #2
sivaji_ganesh_jojodae commentedI confirm this is happening if tried to save default settings as user other than uid 1.
Comment #3
sivaji_ganesh_jojodae commentedThis is fixed now.
Comment #5
edboost commentedGreat! Thanks for the update.
Comment #6
soulston commentedI am still getting the same error using 7.x-4.0-beta1.
It seems to be a conflict between trying to use merge_db when the $user->uid and $node->save_def_uid differ (quiz.module line 4188).
Reproduce steps;
- Install quiz, quiz_question, multichoice
- Save the settings as any user (I used uid 1) at /admin/quiz/settings/quiz_form
- Create a new user
- Save the settings form again at /admin/quiz/settings/quiz_form
Comment #7
soulston commentedAs an update I added my own submit handler for this as follows as a temporary measure:
Comment #13
djdevin