homefeaturesDOCUMENTATIONpricingcontact us
technical documentationCATI documentationcookbookrobot

Questionnaire design

Computed questions

BLANK questions

If the keyword "BLANK" is present on the question name instruction, then

  • the question does not display on screen;
  • the value of the first answer category is assigned to the question; and,
  • eventually, the flow follows the simple skip associated with the first answer category.

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:

    REDIRECT CALCUL
    % Text
    REDIRECT = ( $contexte{heure} < 120000 ) ? 1 : 2
    % Categories
    *1*AM
    *2*PM
    % Simple skips
    1 = ~Q_AM
    2 = ~Q_PM
    % Display condition
    % Open parts
    ! ===================================================<

CALCUL questions

If the keyword "CALCUL" is present on the question name instruction, CallWeb expects the question text to use the following syntax:

    output_variable = perl_expression

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:

    Q3 MIN=0 MAX=1
    % question
    [EN]How many people from each of the following age groups live in your household, including you who have already indicated being over 17?
    [FR]Combien de personnes de chacun des groupes d'âges suivants votre ménage compte-t-il en vous incluant et compte tenu que vous avez déjà indiqué être âgé de plus de 17 ans?
    % note
    [SUFFIX:A][EN]Less than 10 years old[FR]Moins de 10 ans
    [SUFFIX:B][EN]From 11 to 17 years old[FR]De 11 à 17 ans
    [SUFFIX:C][EN]18 and more[FR]18 ans ou plus
    % categories
    *1*=*[EN]Number of people[FR]Nombre de personnes
    % skips
    % condition
    % open-end
    1 = N2.0 0 10
    ! ==================================================
    Q3D MIN=0 MAX=1
    % question
    =Q3A
    % note
    [EN]<COMPUTE BUTTON>CALCQ3,Sum up</COMPUTE BUTTON>[FR]<BOUTON CALCULE>CALCQ3,cw/additionner.gif</BOUTON CALCULE>
    % categories
    *1*NM*[EN]&&ACALCQ3[FR]&&ACALCQ3
    % skips
    % condition
    % open-end
    ! ==================================================
    CALCQ3 CALCUL
    % question
    ACALCQ3 = $AQ3A + $AQ3B + $AQ3C
    % note
    % categories

    % skips
    % condition
    % open-end
    1 = N3.0 0 999
    ! ==================================================

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:

    RANDT(number,output_variable)
    RANDT(input_variable,output_variable)

The RANDT function returns, in "output_variable", a random integer between 1 and either NUMBER or the value of the variable named "input_variable".