Hi there
just looking for a bit of help
I am putting together a farm survey asking two questions, does your
household farm and then how many farms do you have
I am then looking to record the location of each farm and based on the
answer to the question how many farms do you have, then presenting an equal
number of questions
and only show these to someone that says they farm
so using group to show the questions
group selected(${farm}, 'yes')
but looking to amend the code
selected(${num-plot}, '1')
to be something like this
selected(${num-plot}, '1,2,3')
selected(${num-plot}, '2,3')
selected(${num-plot}, '3')
etc
so someone answering 3 will be shown all questions and someone ansering 1
wil only be shown the first one
any thoughts
Cheers
Jon
Hi
Thanks both of you for the help and I have used a combination of
suggestions from both of you
I used the repeat to tidy up the form rather than the "selected" command
but then added another column into the form called "repeat_count"
then added a value in the "begin repeat" row as"int(${num-plot})"
this took the answer from the question "How many plots are you (as a
household) farming at the moment? "
turned it into an integer to be sure and then used it as the value to
control the number of repeats
Nice little feature I didnt know about before and was a very nice solution
to the problem
Thanks
Jon
Repeats sounds a reasonable approach, however if you were looking at
flattening the repeated records you could use the approach Jon was
suggesting. The correct approach to checking for the selection of multiple
options would presumably be to use and / or to join the selected functions.
selected(${num-plot}, '1') or selected(${num-plot}, '2') or
selected(${num-plot},
'3')
// questions for plot 1,2,3
selected(${num-plot}, '2') or selected(${num-plot}, '3')
// question for plot 2, 3
selected(${num-plot}, '3')
// question for plot 3 only
regards
Neil
···
On Tue, Nov 19, 2013 at 5:05 AM, Bashir Jahed wrote:
Hi Jon
Look at using repeats.
Bash
On 18 Nov 2013 14:23, "Jon Parsons" j.parsons@globalcanopy.org wrote:
Hi there
just looking for a bit of help
I am putting together a farm survey asking two questions, does your
household farm and then how many farms do you have
I am then looking to record the location of each farm and based on the
answer to the question how many farms do you have, then presenting an equal
number of questions
and only show these to someone that says they farm
so using group to show the questions
group selected(${farm}, 'yes')
but looking to amend the code
selected(${num-plot}, '1')
to be something like this
selected(${num-plot}, '1,2,3')
selected(${num-plot}, '2,3')
selected(${num-plot}, '3')
etc
so someone answering 3 will be shown all questions and someone ansering 1
wil only be shown the first one
any thoughts
Cheers
Jon
--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en
You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Smap Consulting http://smap.com.au/| Mobile Data Collection Solutions
Application Developer - neilpenman@gmail.com minqiang.huang@gmail.com
Twitter: @dgmsot
Skype: ianaf4you
Phone: +61 402 975 959
Blog: http://blog.smap.com.au http://smap.com.au/blog