Index: backup/moodle2/restore_qtype_plugin.class.php =================================================================== --- backup/moodle2/restore_qtype_plugin.class.php (revision 16961) +++ backup/moodle2/restore_qtype_plugin.class.php (revision ) @@ -146,8 +146,9 @@ $sql = 'SELECT id FROM {question_answers} WHERE question = ? + AND id = ? AND ' . $DB->sql_compare_text('answer', 255) . ' = ' . $DB->sql_compare_text('?', 255); - $params = array($newquestionid, $data->answertext); + $params = array($newquestionid, $oldid, $data->answertext); $newitemid = $DB->get_field_sql($sql, $params); // If we haven't found the newitemid, something has gone really wrong, question in DB // is missing answers, exception