Questionnaire design
Computed questions
BLANK questions
If the keyword "BLANK" is present on the question name instruction, then
A BLANK question can be associated with a display condition to attribute a value to the question conditional on previous answers or to perform complex skips.
Complex skips
A simple skip associated with the first answer category of BLANK questions is honoured. Therefore, BLANK questions can be used to implement complex skips via the display condition, i.e., the complex skip logic is placed in the display condition and the destination of the skip is associated with the first category of the question.
Complex skips can also be implemented via CALCUL questions (see the next paragraph). In this case, a calculation is made, returning a value into the same question (for example; this is not a necessity, as long as there is a value in the CALCUL question to use for skips), and response categories are associated with simple skips. For example, using the contexte system variable, the following code checks whether the current time is before or after noon and redirects the questionnaire flow accordingly:
CALCUL questions
If the keyword "CALCUL" is present on the question name instruction, CallWeb expects the question text to use the following syntax:
This returns the result of the evaluation of "perl_expression" in "output_variable". The "perl_expression" must follow Perl syntax and question names must be prefixed with "$". Please refer to the questionnaire driving Circum Network Inc.'s EchantiCalc script for several examples of use of this feature.
Some special functions can be used in a CALCUL question to perform survey-specific actions. Among them are:
COMPUTE BUTTON feature
It is sometimes useful to perform a mathematical operation right on a page, such as summing a series of numerical answers and displaying the total. This can be accomplished by adding a button on the page; that button performs the operations programmed in a CALCUL question and then redisplays the same page where a recall of values can be performed.
Syntax of the COMPUTE BUTTON:
<COMPUTE BUTTON>CALCUL_QUESTION, text</COMPUTE BUTTON>or<BOUTON CALCULE>CALCUL_QUESTION, text</BOUTON CALCULE>
CALCUL_QUESTION is the name of the CALCUL question triggered by the button. The text which follows the CALCUL_QUESTION and a comma is displayed as part of the button. If this text happens to be the name of a (image) file, that image is used to display the button. In this case, a third portion, still delimited by a comma, can contain the ALT text of the image. A fourth portion, still delimited by a comma, can contain the keyword NOTEST to ensure that the button calculation is activated even if the data on the page do not conform to the normal validation tests.
For example, the following code:
displays this table:
Note: other Web survey packages perform such operations using JavaScript; in keeping with the CallWeb philosophy, no JavaScript is used in programming this feature. Also, the operations triggered by the COMPUTE BUTTON are totally up to the questionnaire designer (e.g., totalling, sum of products, extraction of data, string manipulation) since they are encapsulated in a CALCUL question which may perform any operation and modify any number of fields.
The display condition of the CALCUL question triggered by the button is enforced.
RANDOM questions
RANDT is now deprecated. Please use the random_integer function described above.
If the keyword "RANDOM" is present on the question name instruction, CallWeb expects the rest of the question to use one of the following syntaxes:
The RANDT function returns, in "output_variable", a random integer between 1 and either NUMBER or the value of the variable named "input_variable".