Loops

I think I know the answer to this question, but I am going to ask
anyway :slight_smile:
Is it possible to program ODK to loop a set number of times,
determined by a number collected in a previous question? For example,
a question asks how many televisions a respondent owns. The respondent
replies that they own three televisions. The next set of five
questions will now loop through three times so as to capture
information about every television the respondent owns.
If this is possible, does anybody happen to have some sample code they
would like to share?
Thanks!

it should be possible, but there is a long standing javarosa bug that
needs to be fixed first. the sample i've uploaded to
http://dpaste.com/277550 is what it'll look like, again that form
definitely causes javarosa (and thus odk) to crash.

the bug report is at
http://bitbucket.org/javarosa/javarosa/issue/4/nested-repeat-ignores-jr-count.
i know drew has reworked all the repeat code a few weeks back, so
maybe he can comment on if the bug has been wiped out...

··· On Fri, Nov 19, 2010 at 11:51, Ulli wrote: > I think I know the answer to this question, but I am going to ask > anyway :) > Is it possible to program ODK to loop a set number of times, > determined by a number collected in a previous question? For example, > a question asks how many televisions a respondent owns. The respondent > replies that they own three televisions. The next set of five > questions will now loop through three times so as to capture > information about every television the respondent owns. > If this is possible, does anybody happen to have some sample code they > would like to share? > Thanks! > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >