Now I am trying to make a questionnaire with the following specifications:
-
Asking respondents which transport to use (A: keep using the mode which the respondent is currently using, or B: a new transport mode) in different conditions of travel time and travel cost compared to the current condition.
-
An example is show below:
-
The combinations of two conditions (reduction of travel time and increment of travel cost) are predetermined in the table below.
To make it in the questionnaire, I used the following techniques:
- In the first calculate question (rnd_choice_number), I set once(int(2*random())+1) in calculation so that the questionnaire randomly returns 1 or 2 when respondents answer.
- Based on the generated random number, I set a lookup function using jr:choice-name in select_one sp_rnd which returns 1-3-5-7 or 2-4-6-8
- In the following calculate type questions (sp_1 to sp_4), I subtracted the first, second and third numbers obtained from select_one sp_rnd
- Subtracted numbers are used in a series of select_one questions (sp_1_time to sp_4_cost) to extract the actual values from the table above
- Finally, in calculate type questions (sp_1_time_c to sp_4_cost_c), the extracted values are stored which are used in the actual question table shown above.
Actually, the questions/notes starting from rnd_choice_number to note13 shouldn’t be displayed in the actual questionnaire as these are used only for the preparation/extraction of the values referred in the actual question table (note type questions are used just for a validation to confirm whether the functions are correctly implemented).
Current issue is that once I set a condition in relevant column in some questions (such as sp_3_time, sp_4_time, sp_3_cost and sp_4_cost) using a condition (${rnd_choice_number} = 999) not to display them in the actual questionnaire, the above workflow won’t be implemented properly. I suppose once I hide those select_one questions, the values cannot be referred by other questions.
Do you have any solutions or alternative methods to make it?
Please find the attached XLSForm for your reference.
sp_test.xlsx (17.0 KB)