Example of Validation, Branching and Scoring |
Note: This example does not use the new custom action Script, which is easier to use.
Open the Example and Index displays.
The display on the left is the Questionnaire Preview, showing what the survey will look like when it is presented to the participant. Page Breaks indicate what questions will be shown on what page. The buttons at the bottom will be presented as appropriate, e.g., no Previous button on the first page. The progress meter starts at 0% complete. If a question is Required or has a Range of valid values, pressing Submit will carry out the desired validation checks.
The display on the right is the Questionnaire Index, showing a bird-eye's views of the questions, their numbers and names, and the values that are recorded for the answers. If the question must be answered or has a set range, it is indicated, for example, as Required. Must be 18-30. Custom Actions are displayed in red. This display is a tremendous aid when dealing with larger and more complex surveys.
Notice how the is_drinker, is_smoker and is_exercise Custom Actions prevent their pages from displaying when the response to the initial question indicates that the visitor doesn't drink, smoke, or exercise. Notice how the if_covered Custom Action branches skips to show_score if the answer to 'insurance' indicates that the individual has adequate insurance.
This example also illustrates the use of WeightedScore in the calc_score question, where it calculates the sum of the values entered for questions amount_drink, amount_smoke and amount_exercise, weighted by appropriate values, and stores the result in a hidden question risk_score. This calculated value is used in the last page in question show_score, which uses question piping to show the value of the calculated score as [/risk_score]. Note that it is necessary to turn on the Tally option for risk_score to use it in Univariate and Crosstabulation analysis.