You are here

function matching_update_7501 in Quiz 7.5

Make the matching schema look more like the rest of the questions.

File

question_types/matching/matching.install, line 167
Matching questions install file.

Code

function matching_update_7501() {
  db_add_field('quiz_matching_user_answers', 'result_answer_id', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => FALSE,
  ));
  $sql = "UPDATE {quiz_node_results_answers} ra\n    INNER JOIN {quiz_matching_user_answers} mua ON mua.result_id = ra.result_id\n    INNER JOIN {quiz_matching_node} mn ON mn.match_id = mua.match_id\n    SET mua.result_answer_id = ra.result_answer_id";
  db_query($sql);
  db_drop_field('quiz_matching_user_answers', 'result_id');
}