Skip to content

external_sub_items

Overview

Sub items of imported questions (CS's sub_item), mainly the columns of a text matrix.

Table Definition

Logical name Physical name Column Type PK Relation Unique Nullable Default Notes
External sub item external_sub_items id uuid โ—ฏ gen_random_uuid()
external_question_id uuid external_questions:id (cascade)
external_id bigint Sub item ID on the CS side. Referenced by branch conditions
sentence text โ—ฏ Text of the sub item
order_index integer โ—ฏ Position within the question
raw jsonb Raw JSON of the sub item object

Relations

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

Indexes

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

Notes

  • Matrix cell conditions: a branch condition on a CS matrix question becomes a cell-level condition by specifying both answer_item_id (row) and sub_item_id (column)
  • The extension's conversion maps text matrix rows to answer_items and columns to sub_items
  • raw sometimes contains an answer_type field (a case where the sub item side also carries format information)
  • When registered into the question library, sub items are stored as normalized_payload.subItems. The design tool's schema has nowhere to store matrix sub items, so reusing such a question writes them into the note text