Question about repeat groups: how to make a multiple choice list out of answers from a repeat group question?

Backgroung:
My survey includes a repeat group to capture information about each
household member one by one. E.g. We start with household member #1 (Suzy),
and ask them a series of questions. Then we add a group member on the PDA,
pick household member #2 (Andy) and ask them the same series of questions.
Continue for all household members.

Later in the same survey (not part of the above repeat group), we ask about
household chores and who is in charge.

Question:
Is it possible (and if so, how) to include in this chores section a
question that allows the respondent to choose the name of a household
member from a list composed of the names given in answers in the original
household member repeat group?
E.g. Who is in charge of gardening (Select all that apply)

  • Suzy
  • Andy
  • Lisa
  • Chuck

Yes, you actually can do this. The limitation is that you have to assume an
upper limit to the number of household members (e.g., no more than 7
members in the attached form). The attached form illustrates how to capture
the selections and use a selection index to reference back to an individual
in later questions.

I am not sure how to declare this in XLSForm, and it may not be possible to
define it in Build.

Mitch

choiceOfRepeat.xml (2.55 KB)

··· On Mon, Feb 4, 2013 at 2:54 AM, Sam wrote:

Backgroung:
My survey includes a repeat group to capture information about each
household member one by one. E.g. We start with household member #1 (Suzy),
and ask them a series of questions. Then we add a group member on the PDA,
pick household member #2 (Andy) and ask them the same series of questions.
Continue for all household members.

Later in the same survey (not part of the above repeat group), we ask
about household chores and who is in charge.

Question:
Is it possible (and if so, how) to include in this chores section a
question that allows the respondent to choose the name of a household
member from a list composed of the names given in answers in the original
household member repeat group?
E.g. Who is in charge of gardening (Select all that apply)

  • Suzy
  • Andy
  • Lisa
  • Chuck

--

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

And another limitation is that this only works well for top-level repeat
groups. If you have repeats within repeats, there are bugs in the XML
processor (javarosa) that make it difficult or impossible to reliably
reference data values in the inner repeats.

So if you have a household survey asking about residents, and want to ask
about pets of those residents, to avoid javarosa issues, it is best to have
two top-level repeat groups, one getting the list of residents, one getting
the list of pets, with a question in the pet group asking which of the
residents is the pet's owner.

Mitch

··· On Mon, Feb 4, 2013 at 11:04 AM, Mitch S wrote:

Yes, you actually can do this. The limitation is that you have to assume
an upper limit to the number of household members (e.g., no more than 7
members in the attached form). The attached form illustrates how to capture
the selections and use a selection index to reference back to an individual
in later questions.

I am not sure how to declare this in XLSForm, and it may not be possible
to define it in Build.

Mitch

On Mon, Feb 4, 2013 at 2:54 AM, Sam samantha.elghanayan@gmail.com wrote:

Backgroung:
My survey includes a repeat group to capture information about each
household member one by one. E.g. We start with household member #1 (Suzy),
and ask them a series of questions. Then we add a group member on the PDA,
pick household member #2 (Andy) and ask them the same series of questions.
Continue for all household members.

Later in the same survey (not part of the above repeat group), we ask
about household chores and who is in charge.

Question:
Is it possible (and if so, how) to include in this chores section a
question that allows the respondent to choose the name of a household
member from a list composed of the names given in answers in the original
household member repeat group?
E.g. Who is in charge of gardening (Select all that apply)

  • Suzy
  • Andy
  • Lisa
  • Chuck

--

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

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

Thanks, Mitch.
Does anyone know how to declare this in XLSForm?

Sam

··· On Monday, February 4, 2013, Mitch S wrote:

Yes, you actually can do this. The limitation is that you have to assume
an upper limit to the number of household members (e.g., no more than 7
members in the attached form). The attached form illustrates how to capture
the selections and use a selection index to reference back to an individual
in later questions.

I am not sure how to declare this in XLSForm, and it may not be possible
to define it in Build.

Mitch

On Mon, Feb 4, 2013 at 2:54 AM, Sam <samantha.elghanayan@gmail.com<javascript:_e({}, 'cvml', 'samantha.elghanayan@gmail.com');> wrote:

Backgroung:
My survey includes a repeat group to capture information about each
household member one by one. E.g. We start with household member #1 (Suzy),
and ask them a series of questions. Then we add a group member on the PDA,
pick household member #2 (Andy) and ask them the same series of questions.
Continue for all household members.

Later in the same survey (not part of the above repeat group), we ask
about household chores and who is in charge.

Question:
Is it possible (and if so, how) to include in this chores section a
question that allows the respondent to choose the name of a household
member from a list composed of the names given in answers in the original
household member repeat group?
E.g. Who is in charge of gardening (Select all that apply)

  • Suzy
  • Andy
  • Lisa
  • Chuck

--

Post: opendatakit@googlegroups.com <javascript:_e({}, 'cvml',
'opendatakit@googlegroups.com');>
Unsubscribe: opendatakit+unsubscribe@googlegroups.com <javascript:_e({},
'cvml', 'opendatakit%2Bunsubscribe@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 <javascript:_e({},
'cvml', 'opendatakit%2Bunsubscribe@googlegroups.com');>.
For more options, visit https://groups.google.com/groups/opt_out.

--
Mitch Sundt
Software Engineer
University of Washington
mitchellsundt@gmail.com <javascript:_e({}, 'cvml',
'mitchellsundt@gmail.com');>

--

Post: opendatakit@googlegroups.com <javascript:_e({}, 'cvml',
'opendatakit@googlegroups.com');>
Unsubscribe: opendatakit+unsubscribe@googlegroups.com <javascript:_e({},
'cvml', 'opendatakit%2Bunsubscribe@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 <javascript:_e({},
'cvml', 'opendatakit%2Bunsubscribe@googlegroups.com');>.
For more options, visit https://groups.google.com/groups/opt_out.

--

Samantha Elghanayan
Project Associate, Innovations for Poverty Action
+232 (0) 78 203075
+232 (0) 88 752221

Hi Sam,
This is definitely not possible in XLSForm at the moment and from my
initial investigation it looks like it could be tricky to add in.
Have you considered adding a "Is this person in charge of gardening?"
question inside the repeat group instead?

Mitch, do you know if itemsets can have a nodeset attribute
that references a repeat group? If we were to add this to XLSForm I would
be inclined to do it by adding a column for setting the nodeset.

Regards,
-Nathan

Hi Nathan,

It would be difficult to add the chores questions inside the repeat group
bc this is a follow-up survey, so the questions and order of questions need
to be more or less as they were in the previous survey. (Also there are 26
chores...)

However, I could make the original household roster repeat group into a
simple set of questions that are repeated in the code but not actually a
repeat group.
In this case, would there be a way to make a list out of the answers to all
the "What is the HH member's name?" questions. (In the example below, the
list would be the values for: hh_mm_name_1, hh_mm_name_2, ... hh_mm_name_n
-- n being the upper limit on # of household members)

Thanks,
Sam

E.g.
Currently, this is the repeat section:
type name label begin repeat B1 Roster calculate hhid_roster HHID
integer roster_num What is the HH member's ROSTER NUMBER text hh_mm_name NAME
of household member select_one age_groups hh_mm_age What is the HH
member's AGE? select_one gender hh_head_gender What is the HH member's
GENDER? select_one relationship hh_mm_relation What is the HH member's
RELATION TO the head of household? end repeat

Instead I could just repeat the questions in the code and assume an upper
limit on household members:

type name label calculate hhid_roster_1 HHID integer roster_num_1 What
is the HH member's ROSTER NUMBER text hh_mm_name_1 NAME of household
member select_one
age_groups hh_mm_age_1 What is the HH member's AGE? select_one gender
hh_head_gender_1 What is the HH member's GENDER? select_one relationship
hh_mm_relation_1 What is the HH member's RELATION TO the head of household?
calculate hhid_roster_2 HHID integer roster_num_2 What is the HH member's
ROSTER NUMBER text hh_mm_name_2 NAME of household member select_one
age_groups hh_mm_age_2 What is the HH member's AGE? select_one gender
hh_head_gender_2 What is the HH member's GENDER? select_one relationship
hh_mm_relation_2 What is the HH member's RELATION TO the head of household?

··· On Mon, Feb 11, 2013 at 8:05 PM, Nathan wrote:

Hi Sam,
This is definitely not possible in XLSForm at the moment and from my
initial investigation it looks like it could be tricky to add in.
Have you considered adding a "Is this person in charge of gardening?"
question inside the repeat group instead?

Mitch, do you know if itemsets can have a nodeset attribute
that references a repeat group? If we were to add this to XLSForm I would
be inclined to do it by adding a column for setting the nodeset.

Regards,
-Nathan

--

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.