Skip to content

external_questions

Overview

Questions belonging to a questionnaire imported from an external tool.

Table Definition

Logical name Physical name Column Type PK Relation Unique Nullable Default Notes
External question external_questions id uuid โ—ฏ gen_random_uuid()
external_survey_id uuid external_surveys:id (cascade)
external_id bigint Question ID on the CS side
answer_type integer โ—ฏ CS question format code
answer_type_name varchar(100) โ—ฏ Display name of the format. "ๆ็คบใ‚นใƒ†ใƒƒใƒ—" acts as the section divider
rendered_sentence text โ—ฏ The rendered prompt text
order_index integer โ—ฏ Position within the questionnaire
any_logic boolean false Whether branch logic is configured
any_visibility boolean false Whether visibility logic is configured
raw jsonb Raw JSON of the question object

Relations

  • external_survey_id โ†’ external_surveys.id (onDelete: cascade)
  • Referenced by: external_answer_items.external_question_id (cascade)
  • Referenced by: external_sub_items.external_question_id (cascade)
  • Referenced by: external_logics.external_question_id (cascade)
  • Referenced by: question_library_items.source_external_question_id (cascade)

Indexes

  • Primary key (id)
  • UNIQUE INDEX: external_questions_survey_external_id_idx (external_survey_id, external_id)

CS answer_type

The main mappings used by the extension's conversion.

answer_type Meaning Design tool question type
2 Selection (SA / MA) single / multi
5 Text input free_text
11 Text matrix matrix
14 Intro step intro
18 Survival text Out of scope
21 Pulldown pulldown
22 Final step intro (complete / screen out)

Notes

  • Splitting into section candidates: CS has no concept of sections, so questions whose answer_type_name is ๆ็คบใ‚นใƒ†ใƒƒใƒ— are used as dividers
  • Distinguishing final steps: questions with answer_type 22 carry no flag distinguishing complete from screen out. Meaning is determined by position (right after the last question = complete, at the very end = screen out)
  • any_logic / any_visibility indicate whether branch or visibility logic is present, useful for narrowing down what to analyze after an import