|Compatibility:||IdSurvey 7||IdSurvey 8|
IdCode is the questionnaire in script format.
For other articles, consult the “IdCode” section of this knowledge base.
To write the questionnaire of your survey with IdCode, using question and answer properties you can:
- click on “Import from script”, if you’ve just created your survey and it’s the first time you open “Questions” section
- 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
In IdCode you can specify question properties in any type of question or answer.
Question and answer properties
Question property (type of question) has to be specified near the question code leaving one empty space between code and property.
Answer property (type of answer) has to be specified near the answer text leaving one empty space between text and property. This works also for grid rows.
Properties (types of questions):
->ssingle select (if not specified, the question/answer is single select by default)
->Mmultiple choice e.g.
- Maximum answers in multiple choice question,
leave a space after the page code and write:
/MMaxmaximumanswersnumber (for example, writing
Q3 ->M /MMax 2, I set 2 maximum answers in a multiple choice question).
- Minimum answers in multiple choice question
leave a space after the page code and write:
/Mminminimumanswersnumber (for example, writing
Q3 ->M /Mmin 3, I set 3 minimum answers in a multiple choice question)
->Ttext (open end) e.g.
->TMlong text (multiline) e.g.
>A /O "S,Option 1;Option 2"assisted answer – dropdown – with option manually inserted e.g.
Q3 -> A /O "S,Yes;No"
>A /O "F,filename.txt"assisted answer – dropdown – with option inserted with file e.g.
Q3 ->A /O "F,countries.txt"(NOTE: The uploaded file must be encoded as Unicode-UTF8)
->A /O "S,Option 1;Option 2" /AC 1autocomplete with option manually inserted e.g. Q3 -> A /O “S,Morning;Afternoon;Late Afternoon;Evening;Night” /AC 1
>A /O "F,filename.txt" /AC 1autocomplete with option inserted with file e.g.
Q3 ->A /O "F,countries.txt" /AC 1
(NOTE: The uploaded file must be encoded as Unicode-UTF8)
->T /V "D,format:dd/mm/yyyy"date (open end, text) expressed as dd/mm/yyyy, wich can be modified to mm/dd/yyyy or yyyy-mm-dd. e.g.
Q3 ->T /V "D,format:mm/dd/yyyy"
->P /O "quality:low,allowlibrary:true"allows the upload of image files in the answer. “low” can be swapped with “medium” or “high” to allow an higher resolution after the upload, while “true” can be changed to “false”, forcing to take a picture instead of uploading a pre-existing image file. e.g.
Q3 ->P /O "quality:high,allowlibrary:false"
->RT /O "kind:TYPE,numbers:N,customlabels:true,labels:['','','','','']"rating answer. TYPE must be changed to one of the following: star (it uses stars to express a vote), smile (emoji) o like (thumbs up/down). Depending on the chosen type, you will have to change N to an integer value, that represents the number of possible answers: 5 or 10 for stars; 3, 5 or 10 for emojis; 2 for likes. It is possible to create custom labels for each value, adding text between the ” apexes in the square brackets. You can also declare
customlabels:falseto completely remove the brackets’ content and avoid showing any label. Note: the labels can be left empty, but their number must be equal to the chosen N value e.g.
Q3 ->RT /O "kind:like,numbers:2,customlabels:true,labels:['','']"
->SL /O "kind:standard,showvalue:false,minvalue:N,maxvalue:M,step:X,lefttext:'',righttext:''"Standard Slider used to express preference. You can set a minimum (by changing N into any positive integer) and a maximum value (by setting M as any positive integer higher than N). It is also possible to set the value of incremental steps by changing X to a positive integer, to show the current value of the slider (showvalue:true) and to customize the left and right labels by putting text between the ” apexes. e.g.
Q3 ->SL /O "kind:standard,showvalue:true,minvalue:0,maxvalue:100,step:10,lefttext:'Unlikely',righttext:'Likely'"
->SL /O "kind:compare,showvalue:false,minvalue:N,maxvalue:M,step:X,lefttext:'',righttext:''"Comparative slider, the syntax is the same as the standard slider, but the user starts from the center and slides the cursor between the N and M integer values (usually N is negative and M is positive, but you can set them as both positive or negative). N and M aren’t necessarily two identical numbers, but in that case the slider won’t start at 0 but at the average value between them. e.g.
Q3 ->SL /O "kind:compare,showvalue:true,minvalue:-100,maxvalue:100,step:10,lefttext:'Auto',righttext:'Moto'"
->DDSimple Drag & Drop question, it allows to oder the answer options by user preference, dragging them vertically. e.g.
->DDSSelective Drag & Drop question, it allows to select only a certain number of options and order them in a box on the right, based on user preference. It is possible to set a minimum and a maximum number of options that can be selected and dragged on the right by using the same syntax of multiple choice questions. e.g.
Q3 ->DDS /MMax 3 /Mmin 1
/RQ 0makes the selected answer non-mandatory. e.g
1 /RQ 0
In the same question you can have multiple types of answers. In this case, you specify near the question code the generic type of question and then you specify near the answer text the type of different answers you may have.
Let’s see an example of IdCode: