Deleting Response generating Repeat Group questions causes CommCare App to Crash - Solutions?

Hello!

Problem: Our application crashes (force closes and does not preserve all
data collected until that point) if we scroll back to a question and
delete/change a response which would have generated a repeat group. For
example, I have a check box question that ask about current contraception
use. I set up a calculation to count the number of selected items. The
count of selected items is then set as the number of repeat group questions
it should generate. So if 2 contraceptive methods were picked, we will ask
when they started to use each method (pulling in the name of each method
selected into the questions). But if the respondent changes their mind and
says, they actually only meant to say they used 1 contraceptive method,
then the interviewer goes back and un-checks one item. But right as the
response option is unchecked, the program crashes.

What I've tried:
I have tested a couple options and so far can figure that the crashing only
happens when I view a repeat group (not even start filling it out) that was
generated and then go back to try to decrease number of repeat groups
generated. In other words, the application does not crash if:

  • the type of question used to generate the repeat group is changed. The
    application crashes if it's an integer input, a count calculation, or a
    select-only one question used to generate the repeat group
  • the count increases. So if instead of 2 you decide you forgot about
    another contraceptive method and add a 3rd.

I have used a recommendation of using position(..) < repeat count to avoid
displaying more repeat groups than the repeat group count.

Also, I have tried setting up the questions without a repeat group count.
It works alright but I think the same thing happens plus we decided it
would be too difficult to train 'low-literate' users to remember to click
"Add Group" and "Do not add another Group" even when given a reminder in a
label of when these should be done.

Potential Solutions:
I still don't know what's going wrong or how to solve it. I think my only
alternative is to allow respondents to skip a repeat group or to input a
value we know is an "error" value. This would be to avoid decreasing repeat
group count which would cause the application to crash.

Thank you for any help!!!
-Ricardo

Hi Ricardo,

I am sorry to hear about your app crashing.

Would you be able to file a Bug Report
https://confluence.dimagi.com/display/commcarepublic/Bug+Reports so we
can take a closer look into this issue?

Thanks,
Robin Selwitz

··· On Thursday, April 7, 2016 at 11:57:17 AM UTC-4, Ricardo Vera Monroy wrote: > > Hello! > > Problem: Our application crashes (force closes and does not preserve all > data collected until that point) if we scroll back to a question and > delete/change a response which would have generated a repeat group. For > example, I have a check box question that ask about current contraception > use. I set up a calculation to count the number of selected items. The > count of selected items is then set as the number of repeat group questions > it should generate. So if 2 contraceptive methods were picked, we will ask > when they started to use each method (pulling in the name of each method > selected into the questions). But if the respondent changes their mind and > says, they actually only meant to say they used 1 contraceptive method, > then the interviewer goes back and un-checks one item. But right as the > response option is unchecked, the program crashes. > > What I've tried: > I have tested a couple options and so far can figure that the crashing > only happens when I view a repeat group (not even start filling it out) > that was generated and then go back to try to decrease number of repeat > groups generated. In other words, the application does not crash if: > > - the type of question used to generate the repeat group is changed. > The application crashes if it's an integer input, a count calculation, or a > select-only one question used to generate the repeat group > - the count increases. So if instead of 2 you decide you forgot about > another contraceptive method and add a 3rd. > > I have used a recommendation of using position(..) < repeat count to avoid > displaying more repeat groups than the repeat group count. > > Also, I have tried setting up the questions without a repeat group count. > It works alright but I think the same thing happens plus we decided it > would be too difficult to train 'low-literate' users to remember to click > "Add Group" and "Do not add another Group" even when given a reminder in a > label of when these should be done. > > Potential Solutions: > I still don't know what's going wrong or how to solve it. I think my only > alternative is to allow respondents to skip a repeat group or to input a > value we know is an "error" value. This would be to avoid decreasing repeat > group count which would cause the application to crash. > > Thank you for any help!!! > -Ricardo >

Hi Robin Selwitz,

I have submitted a Bug Report. Thank you in advance for your help!
-Ricardo

··· On Thursday, April 14, 2016 at 7:15:21 AM UTC-7, rselwitz wrote: > > Hi Ricardo, > > I am sorry to hear about your app crashing. > > Would you be able to file a Bug Report > so we > can take a closer look into this issue? > > Thanks, > Robin Selwitz > > On Thursday, April 7, 2016 at 11:57:17 AM UTC-4, Ricardo Vera Monroy wrote: >> >> Hello! >> >> Problem: Our application crashes (force closes and does not preserve all >> data collected until that point) if we scroll back to a question and >> delete/change a response which would have generated a repeat group. For >> example, I have a check box question that ask about current contraception >> use. I set up a calculation to count the number of selected items. The >> count of selected items is then set as the number of repeat group questions >> it should generate. So if 2 contraceptive methods were picked, we will ask >> when they started to use each method (pulling in the name of each method >> selected into the questions). But if the respondent changes their mind and >> says, they actually only meant to say they used 1 contraceptive method, >> then the interviewer goes back and un-checks one item. But right as the >> response option is unchecked, the program crashes. >> >> What I've tried: >> I have tested a couple options and so far can figure that the crashing >> only happens when I view a repeat group (not even start filling it out) >> that was generated and then go back to try to decrease number of repeat >> groups generated. In other words, the application does not crash if: >> >> - the type of question used to generate the repeat group is changed. >> The application crashes if it's an integer input, a count calculation, or a >> select-only one question used to generate the repeat group >> - the count increases. So if instead of 2 you decide you forgot about >> another contraceptive method and add a 3rd. >> >> I have used a recommendation of using position(..) < repeat count to >> avoid displaying more repeat groups than the repeat group count. >> >> Also, I have tried setting up the questions without a repeat group count. >> It works alright but I think the same thing happens plus we decided it >> would be too difficult to train 'low-literate' users to remember to click >> "Add Group" and "Do not add another Group" even when given a reminder in a >> label of when these should be done. >> >> Potential Solutions: >> I still don't know what's going wrong or how to solve it. I think my only >> alternative is to allow respondents to skip a repeat group or to input a >> value we know is an "error" value. This would be to avoid decreasing repeat >> group count which would cause the application to crash. >> >> Thank you for any help!!! >> -Ricardo >> >