|Compatibilità:||IdSurvey 6||IdSurvey 7|
In this article you will learn how to design display conditions with IdCode programming language.
To write the questionnaire of your survey with IdCode you can:
- click on “Import from script”, if you’ve just created your survey and it’s the first time you open “Questions” section. If you’re importing a code from version 6 into version 7, please use the “import from IdSurvey 6” button, then proceed normally.
- click on the gearwheel button of the pages box and then on “IdCode – Display script” if you want to work on the code of the entire questionnaire.
- click on the “IdCode” button you find on the top part of each page to work on the code of a single page.
Display conditions influence and lead the interview path and they are used to set when an item of the questionnaire has to be displayed to the respondent.
Display conditions can be inserted in IdCode after any item (sections, pages, group of questions, questions, answers, rows and columns) written in quotation marks and preceded by /F. For example
- For a quick check on display condition coherence and consistency click on the gearwheel button of pages box tools then on “Filter & Logic Control” and run a first check on what you wrote. Make sure you wrote the symbols correctly, you used parenthesis to specify the order and priority of the instructions and you closed the instruction(s) with round brackets.
Comparison symbols that you can use to write your display condition are:
- = = equal
- != different
- < less than
- > greater than
- <= less than or equal to
- >= greater than or equal to
Here’s some of the display conditions you can set next to any item of your questionnaire:
Display if I answered with a specific option
if (‘question code’ ‘comparison symbol’ ‘answer code number’)
Display if I answered with specific options in different questions
if (‘question code’ ‘comparison symbol’ ‘answer code number’ ‘logical operator’ ‘second question code’ ‘comparison symbol’ ‘answer code number’…)
Display if I answered an open end question with a specific value
With this codification you check the open end answer given to a question. To do this you have to write code of the question between square brackets.
If(‘[question code between square brackets]’ ‘comparison symbol’ ‘numerical value’)
Display if at question a03 I wrote a number greater than 19.
Display if a contact field contains a specific value
It is possible to control the value of a field (e.g.: gender) in the contact database. In this case you have to put the name of the field between curly brackets.
Display if gender is male.