logo SmartSurvey / Scripting Docs
Back to Docs

Script Directives

Directives are the building blocks of a .q script file. Every line that starts with * is a directive that controls question type, flow, or structure.

13
Directives
1 *SR Choice
Defines a Single Response question. The respondent must select exactly one option from the defined list.
2 *MR Choice
Defines a Multiple Response question. The respondent can select one or more options from the list.
3 *OPEN Text
Defines an open-text question. Used alone for single text entry, or combined with *REPEAT to generate a list of text entries driven by a previous question.
4 *NUMBER Numeric
Defines a numeric input question with optional MIN:/MAX: constraints for range validation. Can be used alone or with *REPEAT for a list of numeric entries.
5 *GRIDSR Grid
Defines a single-response grid where each row presents a statement and the respondent picks one column option per row. Column options are defined using *GRIDLIST.
6 *GRIDMR Grid
Defines a multiple-response grid where each row allows the respondent to select one or more column options. Column options are defined using *GRIDLIST.
7 *GRIDLIST Grid
Defines a named set of column options for use in *GRIDSR or *GRIDMR questions. A *GRIDLIST can be reused across multiple grid questions in the same script file.
8 *REPEAT Flow
Generates repeated instances of a question — one per selected option from a previous *MR question. The repeated question label is auto-suffixed with the loop index.
9 *INCLUDE Flow
Inserts the contents of another .q file at the current position in the script. Use to modularise large questionnaires or share common question blocks across multiple surveys.
10 *RANK Choice
Defines a Ranking question where the respondent orders items by dragging or numbering them. Each item receives a rank (1 = most preferred).
11 *DATE Date/Time
Defines a date input question. The response is stored as YYYYMMDD. Use datevalueof[] to extract year, month, or day components in expressions.
12 *TIME Date/Time
Defines a time input question (HH:MM). Use timediffof[] to calculate the elapsed time between two time questions.
13 *NUMLISTTOTAL Numeric
Defines a numeric allocation question where entries must sum to a predefined total (e.g., 100 for percentage allocation). The TOTAL: directive enforces this constraint.
No matches found