The set defaults
widget can be used to control survey settings within a specific scope and for the whole survey. To define your survey's default settings, attach any applicable tags to the set defaults
widget.
set defaults page title: Survey
autoother placeholder: Specify
autoother size: 8
create timers: y
Typically, set defaults
is placed at the beginning of the survey source to establish basic rules for the entire survey.
Tip! Think of set defaults
as the tool for defining tags or turning components on and off within the survey. It impacts both the survey's survey programming language (SPL) and rendered content. In contrast, think about app config
as the high level survey configuration and metadata.
Details
-
Scope: The
set defaults
settings apply to all SPL and survey content that follow, unless anotherset defaults
is used, or until anend defaults
tag is met. This is called "scope." -
Inheritance: If you apply
set defaults
to a group of questions, those settings are inherited by all questions within that group, unless they are specifically overridden. This is called "inheritance."- Similarly, if you have nested groups or nested
set defaults
, the settings from the outer group orset defaults
are inherited by the inner ones, unless they are specifically overridden.
- Similarly, if you have nested groups or nested
Commonly used tags
Although many tags can be applied to set defaults
, the following tags are most frequently used.
Navigation and page display
Tag | Description |
(alias |
Specifies whether to automatically insert a page break before every question, eliminating the need for manual page breaks. Supports 'y' (default) and 'n' inputs. |
autosubmit |
Controls whether pages autosubmit for single select (radio) questions in Device Diverse, Modern and Flex themes. Supports 'y' (default) and 'n' inputs. |
(alias |
Controls whether or not to display the back button on survey pages. Supports 'y' (default) and 'n' inputs. |
(alias |
Specifies an image to use in place of the default back button image. Accepts a URL path for the custom image or a Perl expression to evaluate. |
(alias |
Controls whether or not to display the continue button on survey pages. Supports 'y' (default) and 'n' inputs. |
(alias |
Specifies an image to use in place of the default continue button image. Accepts a URL path for the custom image or a Perl expression to evaluate. |
page_template_data |
Customizes the behavior of the continue and back buttons in mobile-friendly themes such as Flex, Modern, and Device Diverse. |
page title |
Displays custom text in the survey taker's browser tab. |
Question and option behavior
Tag | Description |
anchor autoother |
Specifies that autoother options in questions will be anchored in place when paired with the |
anchor exclusive |
Specifies that options identified as "exclusive" via the |
autoother placeholder |
Displays a message in all autoother text fields, e.g., "Specify". |
autoother size |
Specifies the size (width) of all autoother text fields in ems, e.g., |
required |
Specifies whether questions must be answered before the page can be successfully submitted. Supports 'y' (default) and 'n' inputs. |
showtag |
Specifies whether to show question tags (IDs) alongside the question text. Supports 'y' and 'n' (default) inputs. |
Global display modes
Tag | Description |
maxdiff mode |
Specifies a global display setting for all MaxDiff exercises in a survey unless a MaxDiff widget contains a mode tag locally to override the maxdiff mode setting. |
question mode |
Specifies a global display setting for all questions in a survey unless a question contains a mode tag locally to override the question mode setting. |
table mode |
Specifies a global display setting for all tables in a survey unless a table contains a mode tag locally to override the table mode setting. |
Miscellaneous
Tag | Description |
(alias |
Creates a variable that tracks the amount of time elapsed within all groups and nested groups. Supports 'y' and 'n' (default) inputs. |
preserve case |
Specifies that the question ID remains in the exact format as it is written in the source code. Supports 'y' and 'n' (default) inputs. |
Additional examples
'set defaults' within a 'start group'
When a respondent advances through a survey, the back button displays automatically and then fades away. To turn the back button off completely for specific questions, place the questions and the set defaults
widget with back button: n
within a group. In the example below, Q1 and Q2 will never display a back button, meanwhile Q3 will display a back button for a few seconds.
start group: DEMOGRAPHICS
set defaults
back button: n
1. What is your gender?
type: radio
1. Male
2. Female
3. Non-binary
2. What is your age?
type: radio
1. 18-24
2. 25-34
3. 35-44
4. 45-54
5. 55 or older
end group: DEMOGRAPHICS
3. How do you commute to work?
instructions: Select all that apply.
type: checkbox
1. Drive
2. Ride share
3. Public transit
4. Walk
5. Bike
99. I do not commute for work {exclusive: y}
global mode settings
If all the questions, tables, or MaxDiffs in your survey need to use a non-default display mode, you can specify the mode in the set defaults
widget to apply the changes globally.
set defaults
table mode: textabove, buttons
question mode: classic
maxdiff mode: mobile
Comments
0 comments
Please sign in to leave a comment.