add_matrix_question
Add a matrix question to a Qualtrics survey with rows as statements and columns as scale points. Supports Likert and other matrix variants like constant sum, with optional inline text entry on rows.
Instructions
Simplified helper to create a matrix question. Choices = rows/statements, Answers = columns/scale points. Defaults to a Likert single-answer matrix; use selector/subSelector for variants (e.g., selector 'CS' + subSelector 'WOTB' for matrix constant sum). Statements may be objects to enable an inline text-entry box on individual rows (e.g., an 'Other (please specify)' row).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockId | Yes | The block ID to add the question to | |
| selector | No | Matrix selector (default: Likert) | |
| surveyId | Yes | The Qualtrics survey ID | |
| statements | Yes | Array of statement/row labels; pass an object instead of a string to enable per-row inline text entry | |
| scalePoints | Yes | Array of scale point labels (e.g., ['Strongly Disagree', ..., 'Strongly Agree']) | |
| subSelector | No | Sub-selector; must match the selector. Likert: SingleAnswer|MultipleAnswer|DL, RO: DND|TX, TE: Short|Medium|Long|Essay, CS: WOTB|WTB (default: SingleAnswer for Likert) | |
| questionText | Yes | The question text/instructions | |
| recodeValues | No | Numeric recode mapping for scale points, keyed by answer id, e.g., {"1": "1", "2": "2"} | |
| dataExportTag | No | Custom export tag for the question column names (recommended; derived uniquely from questionText if omitted) | |
| forceResponse | No | Require a response for all statements (default: false) |