DEFINITIONS
Introduction
In the CAWI language, the part of a question definition that specifies
the type of response is called the QUESTION DOMAIN. Supported
question domains include text, numbers, category lists, dates, times
and binary objects including images, audio and other files.
You can declare question domains either:
- In the
DEFINITIONSsection and refer to them by name in the declarations of your questions; or - Directly within the declaration of a question in the
QUESTIONSsection.
Syntax
A definition in the DEFINITIONS section has the following syntax:
IDENTIFIER [ MULTI-STRINGS ] '=' QUESTION-DOMAIN
Where:
- IDENTIFIER is the name of the definition
- MULTI-STRINGS is an optional label used in the metadata for the definition
- QUESTION-DOMAIN is the domain being defined.
These terms including the full list of available question domains are documented in the QUESTIONS part of this documentation.
Examples
For example, in the following DSC script, we declare three question
domains - lst_gender, lst_dnkref and age_type.
The declaration of Q1 includes its domain inline and Q2 and Q3 are examples of extended
domains, with combinations of inline and referenced domains.
DEFINTIIONS
lst_gender = {
1 "Male",
2 "Female",
3 "Other"
}
lst_dnkref = {
DNK "I don't know",
REF "I would prefer not to say"
}
// All ages are integers between 0 and 100
age_type = INTEGER[0,100]
QUESTIONS
Q1 "What is your name?" : TEXT[50]
Q2 "What is your gender?" : lst_gender + lst_dnkref
Q3 "What is your date of birth?" : DATE + lst_dnkref
Q4 "What is your age?" : age_type