Got these errors while adding MCQs. Am testing with the 7.x dev version of July 13.

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'filtered_html' for column 'answer_format' at row 1: INSERT INTO {quiz_multichoice_answers} (answer, answer_format, feedback_if_chosen, feedback_if_chosen_format, feedback_if_not_chosen, feedback_if_not_chosen_format, score_if_chosen, score_if_not_chosen, question_nid, question_vid) 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); Array ( [:db_insert_placeholder_0] => ewqerqer [:db_insert_placeholder_1] => filtered_html [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => filtered_html [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => filtered_html [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => 0 [:db_insert_placeholder_8] => 10 [:db_insert_placeholder_9] => 12 ) in MultichoiceQuestion->insertAlternative() (line 221 of E:\xampplite\htdocs\d7qz\sites\all\modules\quiz\question_types\multichoice\multichoice.classes.inc).

and

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'qnp.summary_pass_format' in 'field list': SELECT qnp.aid AS aid, qnp.number_of_random_questions AS number_of_random_questions, qnp.max_score_for_random AS max_score_for_random, qnp.pass_rate AS pass_rate, qnp.summary_pass AS summary_pass, qnp.summary_pass_format AS summary_pass_format, qnp.summary_default AS summary_default, qnp.summary_default_format AS summary_default_format, qnp.randomization AS randomization, qnp.backwards_navigation AS backwards_navigation, qnp.repeat_until_correct AS repeat_until_correct, qnp.feedback_time AS feedback_time, qnp.display_feedback AS display_feedback, qnp.quiz_open AS quiz_open, qnp.quiz_close AS quiz_close, qnp.takes AS takes, qnp.show_attempt_stats AS show_attempt_stats, qnp.keep_results AS keep_results, qnp.time_limit AS time_limit, qnp.quiz_always AS quiz_always, qnp.tid AS tid, qnp.has_userpoints AS has_userpoints, qnp.allow_skipping AS allow_skipping, qnp.allow_resume AS allow_resume, qnp.allow_jumping AS allow_jumping FROM {quiz_node_properties} qnp WHERE (vid = :db_condition_placeholder_0) AND (nid = :db_condition_placeholder_1) ; Array ( [:db_condition_placeholder_0] => 11 [:db_condition_placeholder_1] => 9 ) in quiz_load() (line 906 of E:\xampplite\htdocs\d7qz\sites\all\modules\quiz\quiz.module).

Comments

sivaji_ganesh_jojodae’s picture

Status: Active » Fixed

Quiz schema has changed to support the text format changes in d7 core. Disable, uninstall and enable quiz affiliated modules would fix it.

nirvanajyothi’s picture

Yup. Tried disabling & enabling Quiz itself. But the error persists. Will try a new installation and get back.

sivaji_ganesh_jojodae’s picture

Disabling & enabling modules will not affect tables -- you need uninstall.

nirvanajyothi’s picture

It's working well now. Thank you.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

steeph’s picture

Component: Code - Quiz module » Code - Import/Export

I got the same error after upgading to D7. When I have to uninstall the module, does this mean I cannot upgrade quiz to D7 without losing all the data?

sivaji_ganesh_jojodae’s picture

Upgrade path is not supported at the moment. I will consider when I get one of my clients willing to sponsor.

steeph’s picture

Thanks for clarifying. I'll have to wait then. Please let me know if I can help in some way without having a clue about PHP.

rombapa’s picture

I had the same problem (upgrade to D7 with existing Quiz data).
The following worked for me (issue the statements in your SQL client e.g. phpMyAdmin):

ALTER TABLE `quiz_long_answer_node_properties` ENGINE InnoDB;

ALTER TABLE `quiz_long_answer_user_answers` ENGINE InnoDB;

ALTER TABLE `quiz_multichoice_answers` ENGINE InnoDB;
ALTER TABLE `quiz_multichoice_answers` MODIFY `answer_format` varchar(255);
ALTER TABLE `quiz_multichoice_answers` MODIFY `feedback_if_chosen_format` varchar(255);
ALTER TABLE `quiz_multichoice_answers` MODIFY `feedback_if_not_chosen_format` varchar(255);

ALTER TABLE `quiz_multichoice_properties` ENGINE InnoDB;

ALTER TABLE `quiz_multichoice_user_answers` ENGINE InnoDB AUTO_INCREMENT=1;

ALTER TABLE `quiz_multichoice_user_answer_multi` ENGINE InnoDB;

ALTER TABLE `quiz_multichoice_user_settings` ENGINE InnoDB;

ALTER TABLE `quiz_node_properties` ENGINE InnoDB AUTO_INCREMENT=1 ;
ALTER TABLE `quiz_node_properties` ADD `summary_pass_format` varchar(255) NOT NULL;
ALTER TABLE `quiz_node_properties` ADD `summary_default_format` varchar(255) NOT NULL;

ALTER TABLE `quiz_node_relationship` ENGINE InnoDB;

ALTER TABLE `quiz_node_results` ENGINE InnoDB AUTO_INCREMENT=1;

ALTER TABLE `quiz_node_results_answers` ENGINE InnoDB;

ALTER TABLE `quiz_node_result_options` ENGINE InnoDB;
ALTER TABLE `quiz_node_result_options` ADD `option_summary_format` varchar(255) NOT NULL;

ALTER TABLE `quiz_question_latest_quizzes` ENGINE InnoDB AUTO_INCREMENT=1;

ALTER TABLE `quiz_question_properties` ENGINE InnoDB;

ALTER TABLE `quiz_terms` ENGINE InnoDB;

ALTER TABLE `quiz_user_settings` ENGINE InnoDB;
ALTER TABLE `quiz_user_settings` ADD `summary_pass_format` varchar(255) NOT NULL;
ALTER TABLE `quiz_user_settings` ADD `summary_default_format` varchar(255) NOT NULL;

cvdenzen’s picture

Thank you, looks like it works for me. Just had to change "`quiz_" into "`drupal_quiz_" because I had a $db_prefix set in my drupal/sites/xxxxx/settings.php.