Professional > Interview scripting > Writing interview scripts > Questions and responses > Questions with Yes/No responses
 
Questions with Yes/No responses
When a question may have only a Yes or No (or, more correctly, a True or False) answer you may define it so that the question variable is created with a boolean data type.
Syntax
Qname "Text" boolean [{Value1, Value2}];
Parameters
Qname
The question name.
Text
The question text.
Value1 and Value2
The texts to display for the True/Yes and False/No responses. In general, the first value is the True response and the second value is the False response, but this can vary depending on the tool used to present the questionnaire.
If you omit the response texts, the interviewing program displays the question text followed by a single check box. Respondents wanting to answer the question with a Yes or True response should click the check box, others should just click Next to continue and the interviewing will save a False value for the question.
Boolean question with single check box
The question in this example was specified as follows:
Vegetarian "Tick below if you are vegetarian" boolean;
If you want to define responses for the question, you must define two responses and each must consist of one word only. The responses are displayed with radio buttons so only one response may be chosen. For example:
SpecialDiet "Do you follow a special diet
    (e.g. no wheat, no dairy)?" boolean
{
  Yes,
  No
};
See also
Questions with categorical responses