Recipes

This section contains a mix and match of tips, tricks and how-to’s collected by users.

Effects

Rollover

[# RollOverPic(IMGDir() + '/example.jpg', 100) #]

Has the effect that the image shows an enlarged version when the respondent hovers over it with the mouse.

Transform a radio button or checkbox to a clickable image:

[# PictureOption(IMGDir() + '/voorbeeld.jpg', .f., 100) #]

PictureOption transforms the given image into a clickable box. The PictureOption function can be combined with setting ‘hide clicker where possible’. When this option is selected in the question setup, for each subject or answer category that has either PictureOption or TextOption the corresponding checkbox or radio button is hidden. For options that do not have either PictureOption or TextOption, the checkbox or radio button remains visible in order to be able to select it.

Combined image and text in an answer category or subject:

[# TextOption('<img src="' + IMGDir() + '/example.png" width="100"/><br/>Text') #]

This option will show an image as a selectable area, with below that some text.

‘Other, namely…’ with an image using || modifier (don’t forget to set the ‘other’ checkbox in the backend):

[# TextOption('<img src="' + IMGDir() + '/example.png" width="100"/><br/>Other, namely:||', 'yourClassName', .f., 100) #]

Option as textbox, with ‘Other, namely…’ using || modifier (don’t forget to set the ‘other’ checkbox in the backend):

[# TextOption('Other, namely:||', 'yourClassName', .f., 100) #]

Add the following to style your box such as setting the height of the input element:

<style type="text/css">
.yourClassName {
  width: 100px;
  height: 150px;
}
.textinput {
  width: 90px;
  height: 40px;
}
</style>

Exports

Starting your question text with the following construct sets the text of that item for export labels:

<!--@Tekst-->

Routing and filter examples

Below is a representative set with examples of expression that are often used in routing or filter expressions:

Single response: check to see if a given answer is within a certain list:

InList(Q1, 3, 4, 5)

Single response: check to see if a given answer is within a range of values:

Between (Q1, 3, 9)

Single Response, Multiple Subjects: Count the number of subjects with answer values between value 4 and 5:

CountAny('Q1', 4, 5) > 0

Free text: Check if a given textual answer is empty:

Empty(Q1)

Free text: Check if a given textual answer is not empty:

!Empty(Q1)

Misc: Check to see if ‘Other’ was checked for a question labeled Q1 (SR or MR)

Q1Other = 1

Misc: Check to see if ‘Don’t know’ was checked for a question labeled Q1 (SR or MR):

Q1DontKnow = 1

Routing using a script:

In some cases it might be convenient to use a script item that sets the routing. This enables more complex logic than the typical one-lines:

DO CASE
  Case 1=1
        RenderObj.GotoItem = 'EndOverQ'
ENDCASE