Validating a select_one list in xlsform

Hi Team, I have a list of 10 crops displayed in a select_one. I want to set
a loop (repeat) of 5 times each time allowing a user to pick only one crop
up to five crops.

How can I set a a validation such that a crop selected in the 1st loop
cannot be selected in the 2nd or subsequent loops. I prefer an error
message to warn that the selected had been picked prior.

Thanks.

Collins

For things like this, where you have a specific upper bound to the number
of crops (or any other choices) that might be selected, it is best to
"unroll" the loop.

So that you have a flat form with NO repeat groups:

--screen-1--------------------

Select the crops for which you will provide answers, with crop #1 being the
largest cultivated hectares, and crop #5 being the smallest:

Select1 crop #1
select1 crop #2
select1 crop #3
select1 crop #4
select1 crop #5

--screen-2-------------------
Note "You have given the following cultivated hectare ranking for your
crops: <crop#1> ... <crop#5>"

Acknowledge: The crops are listed in the correct order based upon
cultivated hectare (OK)
^--- place the constraint on the crop#1... crop#5 values not being
duplicated on this
Acknowledge widget AND that the user has acknowledged the ordering as
correct.
and have a custom constraint message saying to use the back button to
correct the ordering before continuing.

-----remaining questions----------------------------

question(s) for crop #1
question(s) for crop #2
....
question(s) for crop #5

ยทยทยท ------------------------------------------------- This allows you to enforce some sort of ordering on the crops entered (e.g., by cultivated hectares), have the user confirm this, and then have a flat data record where the first block of responses (for crop #1) have more importance than the 2nd, etc.

On Fri, Feb 14, 2014 at 1:27 AM, Collins McAdoyo collins.adoyo@gmail.comwrote:

Hi Team, I have a list of 10 crops displayed in a select_one. I want to
set a loop (repeat) of 5 times each time allowing a user to pick only one
crop up to five crops.

How can I set a a validation such that a crop selected in the 1st loop
cannot be selected in the 2nd or subsequent loops. I prefer an error
message to warn that the selected had been picked prior.

Thanks.

Collins

--

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.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com