1

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?

SurvivalMachine
  • 7,946
  • 15
  • 57
  • 87
Walu.Q
  • 11
  • 3
  • 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 Answers1

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:

enter image description here

Explanation:

  • The count variable is keeping track of how many times your form repeats your question.
  • The repeat_count field in loop_question states that your repeat should go on if (i) the repeat has ran zero times, or (ii) as soon as the answer "no" is registered in willing_pay.
  • The variable amount calculates the amount you should be showing in willing_pay.

Hope this helps.

Luise
  • 482
  • 1
  • 6
  • 21