I'm working on a survey questionnaire using xlsform for ODK. Where I'm stuck: I have a questions on the from like this: 21. Are you willing to pay for the service if it was offered at $100? The answers can be either Yes, No, or Dont know. If the respondent says Yes, the next Question will need to add $20 to the previous $100 so the question should now read as: 21. Are you willing to pay for the service if it was offered at $120? This should continue until the respondent says No. How can I implement this using xlsform design?
Asked
Active
Viewed 456 times
1
-
What did you try? – parik Jul 27 '17 at 10:41
-
So far I have manually asked the question and number of times with each next question adding a 20 to the previous value i.e.21. Are you willing to pay for the service if it was offered at $100? [Yes or No] 21. Are you willing to pay for the service if it was offered at $120? [Yes or No] .... up to a reasonable high number. The relevance column will then skip the next question when ever the respondent select No. I feel there should be a better way to implement this?? – Walu.Q Jul 31 '17 at 12:47
1 Answers
0
I understand that you need a repeat select_one
loop that goes until No is selected. There is a way to do that through the indefinite-repeat XLSForm.
This is an application of it to your question:
Explanation:
- The
count
variable is keeping track of how many times your form repeats your question. - The
repeat_count
field inloop_question
states that yourrepeat
should go on if (i) therepeat
has ran zero times, or (ii) as soon as the answer "no" is registered inwilling_pay
. - The variable
amount
calculates the amount you should be showing inwilling_pay
.
Hope this helps.

Luise
- 482
- 1
- 6
- 21