In this article
When you add a form to a Survey you actually add four stages of operations to the interview program:
- User interaction: Display one or more forms to the person entering responses and wait for input.
- Check size: Verify that open-ended answers comply with the field width and that numeric answers comply with settings for total number of digits and number of decimals. If not, raise error flag. Note that for performance reasons, no such checks are added here for coded variables (single and grid questions). The length of the codes is checked when the survey is compiled.
- Store: Store the value of entered responses.
- Validate: Check that answers stored comply with the specified data validation rules. If an error has been raised then repeat from 1.
Default Validation Rules
The system provides the following types of built-in error checking:
Required answer testing.
Exclusivity checks.
Other-Specify verification.
Rank order testing.
Answer size tests for fixed-width fields.
Numeric response validation
If you do not like the default handling of 1–4, or prefer to use a less stringent quality scheme for the data you collect, each type of error handling can be turned off individually when generating WI. The system always performs size checks and numeric response validation, because failing to do so will cause database errors. Click the links for descriptions of the tests. A description of each test is provided below:
Required Answer Testing
Required answer testing exists in order to ensure that you get complete responses to your surveys.
- At least one alternative must be checked/selected for a coded variable defined in a single or grid form.
- Textboxes used for input of open responses cannot be left blank.
Note: For multi questions, an answer where no alternatives are checked is considered a valid answer unless it contains “Single punch” alternatives which are subject to the exclusivity testing described next. Required answer testing may be turned off for separate questions by selecting "Not Required" in the question's properties (go to Question Properties Overview for more information).
Exclusivity Testing
Exclusivity testing is used for multi questions that have one or more “Single punch” alternatives. A “single punch” element in a multi form declares a variable that is exclusive within the group of variables declared in the form. If a "single punch" alternative is answered, none of the other alternatives should be answered. So, for example a "None of the above" alternative cannot be answered in combination with any of the other answers.
The exclusivity test assumes that the alternatives given exhaust all possible answer combinations and at least one positive answer is required.
In consequence, the response will only be considered valid if the respondent checks at least one of the none-exclusive or exactly one of the exclusive options, which means that the question will be required.
Other-Specify Validation
Other-Specify validation is used for questions where one or more of the items in the answer list has an “other, specify” text box (i.e. the "other" property is used on one or more of the items in the answer list). Other-Specify validation verifies that:
- The respondent provides a specification to an alternative that has a specify-field if that alternative is checked.
- That the alternative is checked/answered if a specification is provided.
Rank Order Testing
The system applies rank order testing for Ranking questions and grid questions with the "Ordered" property set. Answers must then constitute a set of consecutive integers starting at 1.
Adding Your Own Validation Code
One of the form properties is a text box where you may enter arbitrary script code to validate answers. Depending on the complexity of the validation problem, crafting this code may require a more intimate knowledge of JScript .NET than can be presented in this document.