public function process_extraanswerdata($data) {
        global $DB;

        $extra = $this->qtypeobj->extra_answer_fields();
        $tablename = array_shift($extra);

        $oldquestionid = $this->get_old_parentid('question');
        $questioncreated = $this->get_mappingid('question_created', $oldquestionid) ? true : false;

        if ($questioncreated) {
            $data['answerid'] = $this->get_mappingid('question_answer', $data['id']);
            $DB->insert_record($tablename, $data);
        } else {
            $DB->update_record($tablename, $data);
        }
    }