Randomizing question order?

Hi all,

I was wondering if anyone has any ideas for randomizing question order in a
form.

I'm trying to create a questionnaire to interview households and ask them
to rate their CHWs. Let's say that each village has two CHWs, the names of
which are stored as case properties in a case list, where the village is
the case unit. That is, the case structure is as follows:

VILLAGE CHW1 CHW2

  1. Foo    John   Jane
    
  2. Bar    Mary   Bill
    

etc.

To interview a household, the enumerator should choose the household's
village from the case list, and the form should then ask questions about
each CHW within the village. For simplicity, suppose that there is only one
question type ("How would you rate CHW X?"). Currently, the form manually
repeats this question -- i.e., "How would you rate " and "How would you rate " --
rather than, e.g., using repeat groups.

To minimize order
effectshttp://www.psychwiki.com/wiki/What_are_order_effects%3F,
it would be helpful to randomize the order in which the two questions are
asked during each interview.

I can think of two ways that this might be possible:

  • METHOD 1: Randomly determine which CHW each question references in
    its display syntax.
    I'm envisioning that this would be possible by
    creating a secondary hidden value (e.g., CHW1x) that would have a Calculate
    Condition such as "if(/data/randomnumber>0.5, /data/CHW1, /data/CHW2)" (and
    the converse logic for CHW2x), and then the two questions would reference
    these secondary hidden values rather than the original ones.
  • *METHOD 2: Randomly determine the order in which questions are
    displayed. *This would be possible by having three questions -- one for
    CHW1, another for CHW2, and then a third for CHW1 again. The display
    conditions for the two CHW1 questions would then be
    "/data/randomnumber>0.5" for the first one and "/data/randomnumber<0.5" for
    the second one, to determine which one is displayed.

Two issues to note are: (a) instead of one question per CHW, it's actually
around 20 questions, and (b) the number of CHWs per village ranges from 1
to 3. As a result, Method 2, for example, is somewhat unappealing, since it
would require repeating the question groups in a 1-2-3-1-2-3-1 pattern to
encompass every (ordered) permutation of the three CHWs, which would make
creating and naming the questions rather tedious.

While I hope these methods will work, I wanted to check if anyone knows of
any more efficient methods?

Thanks for any suggestions!
Scott
P.S. Looks like SurveyMonkey has a randomize question
orderhttps://www.surveymonkey.com/blog/en/blog/2011/03/03/question-randomization/feature,
though I haven't tried it.

Scott,

There are a number of ways to accomplish what you're trying to do. For
simplicity I'll offer the method that I think fits in best with our
Application Builder with the least custom code. There are some ways to do
this that don't involve duplicating parameters, but they all involve
heavily custom code in your form that would make it difficult to manage
with the app builder.

I think the easiest thing to do will be to duplicate the list of questions
three times, and have a hidden value at the beginning of each block of
questions which defines which CHW that block refers to. You can hide the
list of questions as a group if there are less CHW's than 3.

If the number is indeed fairly low (like 3) then your permutations are
fairly limited to 6 total options. If we assign a unique ID to each one:

1-2-3 - Value 1
1-3-2 - Value 2
2-1-3 - Value 3
2-3-1 - Value 4
3-1-2 - Value 5
3-2-1 - Value 6

Then we can have one master Hidden Value that calculates a value between 1
and 6 with an even distribution:

permutation = int(random() * 6) + 1

The int() function is a "floor", and our random function is uniform between
0 (inclusive) and 1 (exclusive), so that will give us a uniform
distribution from 1 to 6.

Then each of the three repeats can choose which of the chw's to use based
on the permutation

first_chw_name = if(permutation < 3, chw_1, if(permutation < 5, chw_2,
chw_3))

and so on.

Does that make sense? Unfortunately you'll still need to duplicate the
questions, but at least there will only be one set of duplication per slot,
not per combination.

Unfortunately the other thing you'll need to do is add the random
calculation by editing the source of your xform and inserting some custom
code, so that the random() function is only ever fired once.

Create a hidden value with some name (call it random_number, say) and then
click on advanced -> edit source

Find the node that looks like

replace that with

that will make sure that your random number only gets created once. Also,
once you've made that change, don't change the random_number element in the
form editor again later, as it will remove that change.

-Clayton

··· On Wed, Dec 4, 2013 at 4:44 PM, Scott Lee wrote:

Hi all,

I was wondering if anyone has any ideas for randomizing question order in
a form.

I'm trying to create a questionnaire to interview households and ask them
to rate their CHWs. Let's say that each village has two CHWs, the names of
which are stored as case properties in a case list, where the village is
the case unit. That is, the case structure is as follows:

VILLAGE CHW1 CHW2

  1. Foo    John   Jane
    
  2. Bar    Mary   Bill
    

etc.

To interview a household, the enumerator should choose the household's
village from the case list, and the form should then ask questions about
each CHW within the village. For simplicity, suppose that there is only one
question type ("How would you rate CHW X?"). Currently, the form manually
repeats this question -- i.e., "How would you rate " and "How would you rate " --
rather than, e.g., using repeat groups.

To minimize order effectshttp://www.psychwiki.com/wiki/What_are_order_effects%3F,
it would be helpful to randomize the order in which the two questions are
asked during each interview.

I can think of two ways that this might be possible:

  • METHOD 1: Randomly determine which CHW each question references in
    its display syntax.
    I'm envisioning that this would be possible by
    creating a secondary hidden value (e.g., CHW1x) that would have a Calculate
    Condition such as "if(/data/randomnumber>0.5, /data/CHW1, /data/CHW2)" (and
    the converse logic for CHW2x), and then the two questions would reference
    these secondary hidden values rather than the original ones.
  • *METHOD 2: Randomly determine the order in which questions are
    displayed. *This would be possible by having three questions -- one
    for CHW1, another for CHW2, and then a third for CHW1 again. The display
    conditions for the two CHW1 questions would then be
    "/data/randomnumber>0.5" for the first one and "/data/randomnumber<0.5" for
    the second one, to determine which one is displayed.

Two issues to note are: (a) instead of one question per CHW, it's actually
around 20 questions, and (b) the number of CHWs per village ranges from 1
to 3. As a result, Method 2, for example, is somewhat unappealing, since it
would require repeating the question groups in a 1-2-3-1-2-3-1 pattern to
encompass every (ordered) permutation of the three CHWs, which would make
creating and naming the questions rather tedious.

While I hope these methods will work, I wanted to check if anyone knows of
any more efficient methods?

Thanks for any suggestions!
Scott
P.S. Looks like SurveyMonkey has a randomize question orderhttps://www.surveymonkey.com/blog/en/blog/2011/03/03/question-randomization/feature, though I haven't tried it.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Clayton,

Thanks very much -- this is very helpful and all makes sense.

If I understand correctly, what you've suggested is similar to the Method 1
that I described, except modified to account for the six permutations of
three CHWs, as opposed to only two permutations of two CHWs.

My only question for now is a general one. I've already created the three
question blocks, so it's water under the bridge, but doing so was somewhat
tedious since every group/question needs a unique name. That is, whereas

/data/chw_1/interpersonal_skills/friendliness
/data/chw_2/interpersonal_skills/friendliness

would make naming the variables and processing the data simpler, the form
builder instead requires that each group/question be uniquely named -- i.e.:

/data/chw_1/interpersonal_skills_1/friendliness_1
/data/chw_2/interpersonal_skills_2/friendliness_2

which, when there's several levels of nesting and several duplications,
gets a bit messy.

I imagine there's a justification for this uniqueness requirement, but in
case there's isn't, would this be something worth changing?

Thanks again!
Scott

··· On Fri, Dec 6, 2013 at 6:21 PM, Clayton Sims wrote:

Scott,

There are a number of ways to accomplish what you're trying to do. For
simplicity I'll offer the method that I think fits in best with our
Application Builder with the least custom code. There are some ways to do
this that don't involve duplicating parameters, but they all involve
heavily custom code in your form that would make it difficult to manage
with the app builder.

I think the easiest thing to do will be to duplicate the list of questions
three times, and have a hidden value at the beginning of each block of
questions which defines which CHW that block refers to. You can hide the
list of questions as a group if there are less CHW's than 3.

If the number is indeed fairly low (like 3) then your permutations are
fairly limited to 6 total options. If we assign a unique ID to each one:

1-2-3 - Value 1
1-3-2 - Value 2
2-1-3 - Value 3
2-3-1 - Value 4
3-1-2 - Value 5
3-2-1 - Value 6

Then we can have one master Hidden Value that calculates a value between 1
and 6 with an even distribution:

permutation = int(random() * 6) + 1

The int() function is a "floor", and our random function is uniform
between 0 (inclusive) and 1 (exclusive), so that will give us a uniform
distribution from 1 to 6.

Then each of the three repeats can choose which of the chw's to use based
on the permutation

first_chw_name = if(permutation < 3, chw_1, if(permutation < 5, chw_2,
chw_3))

and so on.

Does that make sense? Unfortunately you'll still need to duplicate the
questions, but at least there will only be one set of duplication per slot,
not per combination.

Unfortunately the other thing you'll need to do is add the random
calculation by editing the source of your xform and inserting some custom
code, so that the random() function is only ever fired once.

Create a hidden value with some name (call it random_number, say) and then
click on advanced -> edit source

Find the node that looks like

replace that with

that will make sure that your random number only gets created once. Also,
once you've made that change, don't change the random_number element in the
form editor again later, as it will remove that change.

-Clayton

On Wed, Dec 4, 2013 at 4:44 PM, Scott Lee scott.s.lee@gmail.com wrote:

Hi all,

I was wondering if anyone has any ideas for randomizing question order in
a form.

I'm trying to create a questionnaire to interview households and ask them
to rate their CHWs. Let's say that each village has two CHWs, the names of
which are stored as case properties in a case list, where the village is
the case unit. That is, the case structure is as follows:

VILLAGE CHW1 CHW2

  1. Foo    John   Jane
    
  2. Bar    Mary   Bill
    

etc.

To interview a household, the enumerator should choose the household's
village from the case list, and the form should then ask questions about
each CHW within the village. For simplicity, suppose that there is only one
question type ("How would you rate CHW X?"). Currently, the form manually
repeats this question -- i.e., "How would you rate " and "How would you rate " --
rather than, e.g., using repeat groups.

To minimize order effectshttp://www.psychwiki.com/wiki/What_are_order_effects%3F,
it would be helpful to randomize the order in which the two questions are
asked during each interview.

I can think of two ways that this might be possible:

  • METHOD 1: Randomly determine which CHW each question references in
    its display syntax.
    I'm envisioning that this would be possible by
    creating a secondary hidden value (e.g., CHW1x) that would have a Calculate
    Condition such as "if(/data/randomnumber>0.5, /data/CHW1, /data/CHW2)" (and
    the converse logic for CHW2x), and then the two questions would reference
    these secondary hidden values rather than the original ones.
  • *METHOD 2: Randomly determine the order in which questions are
    displayed. *This would be possible by having three questions -- one
    for CHW1, another for CHW2, and then a third for CHW1 again. The display
    conditions for the two CHW1 questions would then be
    "/data/randomnumber>0.5" for the first one and
    "/data/randomnumber<0.5" for the second one, to determine which one
    is displayed.

Two issues to note are: (a) instead of one question per CHW, it's
actually around 20 questions, and (b) the number of CHWs per village ranges
from 1 to 3. As a result, Method 2, for example, is somewhat unappealing,
since it would require repeating the question groups in a 1-2-3-1-2-3-1
pattern to encompass every (ordered) permutation of the three CHWs, which
would make creating and naming the questions rather tedious.

While I hope these methods will work, I wanted to check if anyone knows
of any more efficient methods?

Thanks for any suggestions!
Scott
P.S. Looks like SurveyMonkey has a randomize question orderhttps://www.surveymonkey.com/blog/en/blog/2011/03/03/question-randomization/feature, though I haven't tried it.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Scott,

Are you positive that the form builder is requiring the name to be
different? I was under the impression that it produce strong warnings
(since moving the question around could cause conflicts etc) against doing
so, but that it would not prevent you from manually changing them and
creating a build.

-Clayton

··· On Fri, Dec 6, 2013 at 7:34 PM, Scott Lee wrote:

Hi Clayton,

Thanks very much -- this is very helpful and all makes sense.

If I understand correctly, what you've suggested is similar to the Method
1 that I described, except modified to account for the six permutations of
three CHWs, as opposed to only two permutations of two CHWs.

My only question for now is a general one. I've already created the three
question blocks, so it's water under the bridge, but doing so was somewhat
tedious since every group/question needs a unique name. That is, whereas

/data/chw_1/interpersonal_skills/friendliness
/data/chw_2/interpersonal_skills/friendliness

would make naming the variables and processing the data simpler, the form
builder instead requires that each group/question be uniquely named -- i.e.:

/data/chw_1/interpersonal_skills_1/friendliness_1
/data/chw_2/interpersonal_skills_2/friendliness_2

which, when there's several levels of nesting and several duplications,
gets a bit messy.

I imagine there's a justification for this uniqueness requirement, but in
case there's isn't, would this be something worth changing?

Thanks again!
Scott

On Fri, Dec 6, 2013 at 6:21 PM, Clayton Sims csims@dimagi.com wrote:

Scott,

There are a number of ways to accomplish what you're trying to do. For
simplicity I'll offer the method that I think fits in best with our
Application Builder with the least custom code. There are some ways to do
this that don't involve duplicating parameters, but they all involve
heavily custom code in your form that would make it difficult to manage
with the app builder.

I think the easiest thing to do will be to duplicate the list of
questions three times, and have a hidden value at the beginning of each
block of questions which defines which CHW that block refers to. You can
hide the list of questions as a group if there are less CHW's than 3.

If the number is indeed fairly low (like 3) then your permutations are
fairly limited to 6 total options. If we assign a unique ID to each one:

1-2-3 - Value 1
1-3-2 - Value 2
2-1-3 - Value 3
2-3-1 - Value 4
3-1-2 - Value 5
3-2-1 - Value 6

Then we can have one master Hidden Value that calculates a value between
1 and 6 with an even distribution:

permutation = int(random() * 6) + 1

The int() function is a "floor", and our random function is uniform
between 0 (inclusive) and 1 (exclusive), so that will give us a uniform
distribution from 1 to 6.

Then each of the three repeats can choose which of the chw's to use based
on the permutation

first_chw_name = if(permutation < 3, chw_1, if(permutation < 5, chw_2,
chw_3))

and so on.

Does that make sense? Unfortunately you'll still need to duplicate the
questions, but at least there will only be one set of duplication per slot,
not per combination.

Unfortunately the other thing you'll need to do is add the random
calculation by editing the source of your xform and inserting some custom
code, so that the random() function is only ever fired once.

Create a hidden value with some name (call it random_number, say) and
then click on advanced -> edit source

Find the node that looks like

replace that with

that will make sure that your random number only gets created once. Also,
once you've made that change, don't change the random_number element in the
form editor again later, as it will remove that change.

-Clayton

On Wed, Dec 4, 2013 at 4:44 PM, Scott Lee scott.s.lee@gmail.com wrote:

Hi all,

I was wondering if anyone has any ideas for randomizing question order
in a form.

I'm trying to create a questionnaire to interview households and ask
them to rate their CHWs. Let's say that each village has two CHWs, the
names of which are stored as case properties in a case list, where the
village is the case unit. That is, the case structure is as follows:

VILLAGE CHW1 CHW2

  1. Foo    John   Jane
    
  2. Bar    Mary   Bill
    

etc.

To interview a household, the enumerator should choose the household's
village from the case list, and the form should then ask questions about
each CHW within the village. For simplicity, suppose that there is only one
question type ("How would you rate CHW X?"). Currently, the form manually
repeats this question -- i.e., "How would you rate " and "How would you rate " --
rather than, e.g., using repeat groups.

To minimize order effectshttp://www.psychwiki.com/wiki/What_are_order_effects%3F,
it would be helpful to randomize the order in which the two questions are
asked during each interview.

I can think of two ways that this might be possible:

  • METHOD 1: Randomly determine which CHW each question references
    in its display syntax.
    I'm envisioning that this would be possible
    by creating a secondary hidden value (e.g., CHW1x) that would have a
    Calculate Condition such as "if(/data/randomnumber>0.5, /data/CHW1,
    /data/CHW2)" (and the converse logic for CHW2x), and then the two
    questions would reference these secondary hidden values rather than the
    original ones.
  • *METHOD 2: Randomly determine the order in which questions are
    displayed. *This would be possible by having three questions -- one
    for CHW1, another for CHW2, and then a third for CHW1 again. The display
    conditions for the two CHW1 questions would then be
    "/data/randomnumber>0.5" for the first one and
    "/data/randomnumber<0.5" for the second one, to determine which one
    is displayed.

Two issues to note are: (a) instead of one question per CHW, it's
actually around 20 questions, and (b) the number of CHWs per village ranges
from 1 to 3. As a result, Method 2, for example, is somewhat unappealing,
since it would require repeating the question groups in a 1-2-3-1-2-3-1
pattern to encompass every (ordered) permutation of the three CHWs, which
would make creating and naming the questions rather tedious.

While I hope these methods will work, I wanted to check if anyone knows
of any more efficient methods?

Thanks for any suggestions!
Scott
P.S. Looks like SurveyMonkey has a randomize question orderhttps://www.surveymonkey.com/blog/en/blog/2011/03/03/question-randomization/feature, though I haven't tried it.

--
You received this message because you are subscribed to the Google
Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks, Clayton.

You're right -- I tested this out, and even with duplicate IDs the form
does still build.

The exact warning is:

Form Warning

  • chaKnow is a duplicate ID in the form. Question IDs must be unique.

I always interpreted this to mean that the form wouldn't build. Now that I
know, it'll be fine for me, but form a general UX standpoint, this may or
may not be ideal.

Just as a suggestion, a couple other options might be:

  • Instead of reading just the question ID, the form builder reads the
    full location of a question
    (e.g., /data/chw_1/interpersonal_skills/friendliness), and if that is
    unique, no warning is given.
  • The user is given an option of "ignoring" a warning, such that it
    won't re-appear for a given question. Currently, one can "X" out a warning,
    but when one clicks back on the question, the warning re-appears.

Thanks,
Scott

··· On Mon, Dec 9, 2013 at 2:26 PM, Clayton Sims wrote:

Scott,

Are you positive that the form builder is requiring the name to be
different? I was under the impression that it produce strong warnings
(since moving the question around could cause conflicts etc) against doing
so, but that it would not prevent you from manually changing them and
creating a build.

-Clayton

On Fri, Dec 6, 2013 at 7:34 PM, Scott Lee scott.s.lee@gmail.com wrote:

Hi Clayton,

Thanks very much -- this is very helpful and all makes sense.

If I understand correctly, what you've suggested is similar to the Method
1 that I described, except modified to account for the six permutations of
three CHWs, as opposed to only two permutations of two CHWs.

My only question for now is a general one. I've already created the three
question blocks, so it's water under the bridge, but doing so was somewhat
tedious since every group/question needs a unique name. That is, whereas

/data/chw_1/interpersonal_skills/friendliness
/data/chw_2/interpersonal_skills/friendliness

would make naming the variables and processing the data simpler, the form
builder instead requires that each group/question be uniquely named -- i.e.:

/data/chw_1/interpersonal_skills_1/friendliness_1
/data/chw_2/interpersonal_skills_2/friendliness_2

which, when there's several levels of nesting and several duplications,
gets a bit messy.

I imagine there's a justification for this uniqueness requirement, but in
case there's isn't, would this be something worth changing?

Thanks again!
Scott

On Fri, Dec 6, 2013 at 6:21 PM, Clayton Sims csims@dimagi.com wrote:

Scott,

There are a number of ways to accomplish what you're trying to do. For
simplicity I'll offer the method that I think fits in best with our
Application Builder with the least custom code. There are some ways to do
this that don't involve duplicating parameters, but they all involve
heavily custom code in your form that would make it difficult to manage
with the app builder.

I think the easiest thing to do will be to duplicate the list of
questions three times, and have a hidden value at the beginning of each
block of questions which defines which CHW that block refers to. You can
hide the list of questions as a group if there are less CHW's than 3.

If the number is indeed fairly low (like 3) then your permutations are
fairly limited to 6 total options. If we assign a unique ID to each one:

1-2-3 - Value 1
1-3-2 - Value 2
2-1-3 - Value 3
2-3-1 - Value 4
3-1-2 - Value 5
3-2-1 - Value 6

Then we can have one master Hidden Value that calculates a value between
1 and 6 with an even distribution:

permutation = int(random() * 6) + 1

The int() function is a "floor", and our random function is uniform
between 0 (inclusive) and 1 (exclusive), so that will give us a uniform
distribution from 1 to 6.

Then each of the three repeats can choose which of the chw's to use
based on the permutation

first_chw_name = if(permutation < 3, chw_1, if(permutation < 5, chw_2,
chw_3))

and so on.

Does that make sense? Unfortunately you'll still need to duplicate the
questions, but at least there will only be one set of duplication per slot,
not per combination.

Unfortunately the other thing you'll need to do is add the random
calculation by editing the source of your xform and inserting some custom
code, so that the random() function is only ever fired once.

Create a hidden value with some name (call it random_number, say) and
then click on advanced -> edit source

Find the node that looks like

replace that with

that will make sure that your random number only gets created once.
Also, once you've made that change, don't change the random_number element
in the form editor again later, as it will remove that change.

-Clayton

On Wed, Dec 4, 2013 at 4:44 PM, Scott Lee scott.s.lee@gmail.com wrote:

Hi all,

I was wondering if anyone has any ideas for randomizing question order
in a form.

I'm trying to create a questionnaire to interview households and ask
them to rate their CHWs. Let's say that each village has two CHWs, the
names of which are stored as case properties in a case list, where the
village is the case unit. That is, the case structure is as follows:

VILLAGE CHW1 CHW2

  1. Foo    John   Jane
    
  2. Bar    Mary   Bill
    

etc.

To interview a household, the enumerator should choose the household's
village from the case list, and the form should then ask questions about
each CHW within the village. For simplicity, suppose that there is only one
question type ("How would you rate CHW X?"). Currently, the form manually
repeats this question -- i.e., "How would you rate " and "How would you rate " --
rather than, e.g., using repeat groups.

To minimize order effectshttp://www.psychwiki.com/wiki/What_are_order_effects%3F,
it would be helpful to randomize the order in which the two questions are
asked during each interview.

I can think of two ways that this might be possible:

  • METHOD 1: Randomly determine which CHW each question references
    in its display syntax.
    I'm envisioning that this would be possible
    by creating a secondary hidden value (e.g., CHW1x) that would have a
    Calculate Condition such as "if(/data/randomnumber>0.5, /data/CHW1,
    /data/CHW2)" (and the converse logic for CHW2x), and then the two
    questions would reference these secondary hidden values rather than the
    original ones.
  • *METHOD 2: Randomly determine the order in which questions are
    displayed. *This would be possible by having three questions -- one
    for CHW1, another for CHW2, and then a third for CHW1 again. The display
    conditions for the two CHW1 questions would then be
    "/data/randomnumber>0.5" for the first one and
    "/data/randomnumber<0.5" for the second one, to determine which one
    is displayed.

Two issues to note are: (a) instead of one question per CHW, it's
actually around 20 questions, and (b) the number of CHWs per village ranges
from 1 to 3. As a result, Method 2, for example, is somewhat unappealing,
since it would require repeating the question groups in a 1-2-3-1-2-3-1
pattern to encompass every (ordered) permutation of the three CHWs, which
would make creating and naming the questions rather tedious.

While I hope these methods will work, I wanted to check if anyone knows
of any more efficient methods?

Thanks for any suggestions!
Scott
P.S. Looks like SurveyMonkey has a randomize question orderhttps://www.surveymonkey.com/blog/en/blog/2011/03/03/question-randomization/feature, though I haven't tried it.

--
You received this message because you are subscribed to the Google
Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google
Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Scott,

Glad to hear it's working for you.

Definitely agree that the user experience is not great with that warning.
We're hoping to integrate a feature soon that will make this workflow
unnecessary, but adding the ability to "dismiss" errors would definitely be
a helpful feature either way.

-Clayton

··· On Tue, Dec 10, 2013 at 9:29 AM, Scott Lee wrote:

Thanks, Clayton.

You're right -- I tested this out, and even with duplicate IDs the form
does still build.

The exact warning is:

Form Warning

  • chaKnow is a duplicate ID in the form. Question IDs must be unique.

I always interpreted this to mean that the form wouldn't build. Now that I
know, it'll be fine for me, but form a general UX standpoint, this may or
may not be ideal.

Just as a suggestion, a couple other options might be:

  • Instead of reading just the question ID, the form builder reads the
    full location of a question
    (e.g., /data/chw_1/interpersonal_skills/friendliness), and if that is
    unique, no warning is given.
  • The user is given an option of "ignoring" a warning, such that it
    won't re-appear for a given question. Currently, one can "X" out a warning,
    but when one clicks back on the question, the warning re-appears.

Thanks,
Scott

On Mon, Dec 9, 2013 at 2:26 PM, Clayton Sims csims@dimagi.com wrote:

Scott,

Are you positive that the form builder is requiring the name to be
different? I was under the impression that it produce strong warnings
(since moving the question around could cause conflicts etc) against doing
so, but that it would not prevent you from manually changing them and
creating a build.

-Clayton

On Fri, Dec 6, 2013 at 7:34 PM, Scott Lee scott.s.lee@gmail.com wrote:

Hi Clayton,

Thanks very much -- this is very helpful and all makes sense.

If I understand correctly, what you've suggested is similar to the
Method 1 that I described, except modified to account for the six
permutations of three CHWs, as opposed to only two permutations of two CHWs.

My only question for now is a general one. I've already created the
three question blocks, so it's water under the bridge, but doing so was
somewhat tedious since every group/question needs a unique name. That is,
whereas

/data/chw_1/interpersonal_skills/friendliness
/data/chw_2/interpersonal_skills/friendliness

would make naming the variables and processing the data simpler, the
form builder instead requires that each group/question be uniquely named --
i.e.:

/data/chw_1/interpersonal_skills_1/friendliness_1
/data/chw_2/interpersonal_skills_2/friendliness_2

which, when there's several levels of nesting and several duplications,
gets a bit messy.

I imagine there's a justification for this uniqueness requirement, but
in case there's isn't, would this be something worth changing?

Thanks again!
Scott

On Fri, Dec 6, 2013 at 6:21 PM, Clayton Sims csims@dimagi.com wrote:

Scott,

There are a number of ways to accomplish what you're trying to do. For
simplicity I'll offer the method that I think fits in best with our
Application Builder with the least custom code. There are some ways to do
this that don't involve duplicating parameters, but they all involve
heavily custom code in your form that would make it difficult to manage
with the app builder.

I think the easiest thing to do will be to duplicate the list of
questions three times, and have a hidden value at the beginning of each
block of questions which defines which CHW that block refers to. You can
hide the list of questions as a group if there are less CHW's than 3.

If the number is indeed fairly low (like 3) then your permutations are
fairly limited to 6 total options. If we assign a unique ID to each one:

1-2-3 - Value 1
1-3-2 - Value 2
2-1-3 - Value 3
2-3-1 - Value 4
3-1-2 - Value 5
3-2-1 - Value 6

Then we can have one master Hidden Value that calculates a value
between 1 and 6 with an even distribution:

permutation = int(random() * 6) + 1

The int() function is a "floor", and our random function is uniform
between 0 (inclusive) and 1 (exclusive), so that will give us a uniform
distribution from 1 to 6.

Then each of the three repeats can choose which of the chw's to use
based on the permutation

first_chw_name = if(permutation < 3, chw_1, if(permutation < 5, chw_2,
chw_3))

and so on.

Does that make sense? Unfortunately you'll still need to duplicate the
questions, but at least there will only be one set of duplication per slot,
not per combination.

Unfortunately the other thing you'll need to do is add the random
calculation by editing the source of your xform and inserting some custom
code, so that the random() function is only ever fired once.

Create a hidden value with some name (call it random_number, say) and
then click on advanced -> edit source

Find the node that looks like

replace that with

that will make sure that your random number only gets created once.
Also, once you've made that change, don't change the random_number element
in the form editor again later, as it will remove that change.

-Clayton

On Wed, Dec 4, 2013 at 4:44 PM, Scott Lee scott.s.lee@gmail.comwrote:

Hi all,

I was wondering if anyone has any ideas for randomizing question order
in a form.

I'm trying to create a questionnaire to interview households and ask
them to rate their CHWs. Let's say that each village has two CHWs, the
names of which are stored as case properties in a case list, where the
village is the case unit. That is, the case structure is as follows:

VILLAGE CHW1 CHW2

  1. Foo    John   Jane
    
  2. Bar    Mary   Bill
    

etc.

To interview a household, the enumerator should choose the household's
village from the case list, and the form should then ask questions about
each CHW within the village. For simplicity, suppose that there is only one
question type ("How would you rate CHW X?"). Currently, the form manually
repeats this question -- i.e., "How would you rate " and "How would you rate " --
rather than, e.g., using repeat groups.

To minimize order effectshttp://www.psychwiki.com/wiki/What_are_order_effects%3F,
it would be helpful to randomize the order in which the two questions are
asked during each interview.

I can think of two ways that this might be possible:

  • METHOD 1: Randomly determine which CHW each question references
    in its display syntax.
    I'm envisioning that this would be
    possible by creating a secondary hidden value (e.g., CHW1x) that would have
    a Calculate Condition such as "if(/data/randomnumber>0.5,
    /data/CHW1, /data/CHW2)" (and the converse logic for CHW2x), and
    then the two questions would reference these secondary hidden values rather
    than the original ones.
  • *METHOD 2: Randomly determine the order in which questions are
    displayed. *This would be possible by having three questions --
    one for CHW1, another for CHW2, and then a third for CHW1 again. The
    display conditions for the two CHW1 questions would then be
    "/data/randomnumber>0.5" for the first one and
    "/data/randomnumber<0.5" for the second one, to determine which
    one is displayed.

Two issues to note are: (a) instead of one question per CHW, it's
actually around 20 questions, and (b) the number of CHWs per village ranges
from 1 to 3. As a result, Method 2, for example, is somewhat unappealing,
since it would require repeating the question groups in a 1-2-3-1-2-3-1
pattern to encompass every (ordered) permutation of the three CHWs, which
would make creating and naming the questions rather tedious.

While I hope these methods will work, I wanted to check if anyone
knows of any more efficient methods?

Thanks for any suggestions!
Scott
P.S. Looks like SurveyMonkey has a randomize question orderhttps://www.surveymonkey.com/blog/en/blog/2011/03/03/question-randomization/feature, though I haven't tried it.

--
You received this message because you are subscribed to the Google
Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google
Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google
Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.