Desktop User Guides > Professional > Interview scripting > Writing interview scripts > Questions and responses > Questions with Yes/No responses
 
Questions with Yes/No responses
When a question has only a Yes or No (or, more correctly, a True or False) answer, you can define it so that the question variable is created with a boolean data type.
Syntax
<question_name> "<text>" boolean [{<value_1>, <value_2>}];
Parameters
<question_name>
The question name.
<text>
The question text.
<value_1>, <value_2>
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 checkbox. Respondents wanting to answer the question with a Yes or True response should click the checkbox; others should click Next to continue and the interviewing will save a False value for the question.
Boolean question with single checkbox
This graphic is described in the surrounding text.
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 can 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