Skipping a loop

5 views
Skip to first unread message

eric couper

unread,
Jul 26, 2011, 3:25:19 AM7/26/11
to xls2xform
Hello,

One more question for today.

I have a repeat loop built into the survey right now using "begin
repeat" and "end repeat." The loop is part of a larger section that I
only want to appear if the answer the the section's firsat question is
yes.

This limitation works fine with the standard questions; however, the
survey will not skip over the loop.

Example

1. Are you knowledgeable about X topic?
-yes
-no

(for all below questions I included ${knowledgeable}='yes' )

2. Question 2

3. Question 3

begin repeat

Question 4

Question 5

end repeat

When a respondent answers no, the survey skips questions 2 and 3, but
will not skip questions 4 and 5.

Any thoughts?

--
*Eric A. Couper, MPA DP <http://mdp.ei.columbia.edu/>*
ICT & Agriculture Coordinator
African Soil Information Service
e. eric....@gmail.com

Andrew Marder

unread,
Jul 26, 2011, 9:16:32 AM7/26/11
to xls2...@googlegroups.com
Hi Eric,

Try putting the relevant condition directly on the begin repeat, so
the first row of the loop might like like

type = begin repeat , name = my_repeat , label = My Repeat ,
bind:relevant = ${previous_question} = 'yes'
...
type = end repeat

There is a slight problem with this in ODK Collect 1.1.5. Even if the
repeat should be skipped it will ask if you want to add another group.
Answering yes brings the same prompt up again, while answering no
let's you skip the entire loop. It's not ideal and has been fixed in
ODK 1.1.7.

Andrew

eric couper

unread,
Jul 29, 2011, 9:06:10 AM7/29/11
to xls2...@googlegroups.com
Thanks for the explanation, we'll definitely welcome that fix.

Is there any information online about other changes for 1.1.7 and its
timeline for release?

Andrew Marder

unread,
Aug 1, 2011, 10:11:34 AM8/1/11
to xls2...@googlegroups.com
Hi Eric,

I believe the top message on this thread is latest news on the new release.

http://groups.google.com/group/opendatakit/browse_thread/thread/8b668e850f538ebf/40cfd19bb4210b83?lnk=gst&q=collect#40cfd19bb4210b83

Andrew

Reply all
Reply to author
Forward
0 new messages