Skip to content

external_answer_items

Overview

Choices of imported questions (CS's answer_item).

Table Definition

Logical name Physical name Column Type PK Relation Unique Nullable Default Notes
External choice external_answer_items id uuid โ—ฏ gen_random_uuid()
external_question_id uuid external_questions:id (cascade)
external_id bigint Choice ID on the CS side. Referenced by branch conditions
sentence text โ—ฏ Text of the choice
val numeric โ—ฏ Numeric value assigned to the choice
order_index integer โ—ฏ Position within the question
raw jsonb Raw JSON of the choice object

Relations

  • external_question_id โ†’ external_questions.id (onDelete: cascade)

Indexes

  • Primary key (id)
  • UNIQUE INDEX: external_answer_items_question_external_id_idx (external_question_id, external_id)

Meaning per Question Type

In CS, what an answer_item means depends on the question format.

CS question format Meaning of answer_item
Selection (SA / MA) A choice
Text matrix A row (columns live in external_sub_items)
Text input (FA) An input field (several fields within one question are expressed natively)
Pulldown A choice, though branch conditions share the first one and judge by the text value

Notes

  • Negative external_id: in FA branch conditions, answer_item_id can be negative. -1 means "any answer" and -2 means "all answers" (neither points at a real choice)
  • Real CS traffic shows name and sentence holding the same value; this table uses sentence
  • raw also retains fields such as is_shuffle / fix_last / is_pinned (choice randomization) and placeholder (FA fields and pulldown choices)