Trouble with Repeat Question Types in XLSForm

What is the problem? Please be detailed.
I am working to build a survey that will perform a certain number of repeats. The survey is currently structured to:

  1. Collect a Respondent Code
  2. Collect the number of repeats to be performed
  3. Ask a group of questions repeated for the number of times reported in 2
  4. End survey

The problem I am running into is if the user types a number in 2 that is too large and tries to go back and fix it. What ends up happening is that the ODK questionnaire maintains the original number of repeats that were reported and does not adjust it to reflect the new value (i.e. if I type 7 in 2 and then try to change it back to 4, the survey will still perform 7 repeats, not 4).

What ODK tool and version are you using? And on what device and operating system version?
I am using XLSForm and ODK Collect (v1.17.2) on an Android 9 device

What steps can we take to reproduce the problem?
Try creating a repeat question that has a constraint equal to a number entered in a previous question.

What you have you tried to fix the problem?
I am not sure what, if anything, I can do to fix the problem. Is this just a problem with ODK Collect that cannot be fixed, or is it something that would require more advanced coding knowledge of XForms to fix?

Anything else we should know or have? If you have a test form or screenshots or logs, attach here.

Hi @Conor_Gallagher

we know about this problem. Here is the entire thread https://github.com/opendatakit/javarosa/pull/61 Please investigate this comment https://github.com/opendatakit/javarosa/pull/61#issuecomment-345891739. A short summary would be that we resigned from fixing this to avoid accidental data loss. You can find a workaround there too.

1 Like

Hi @Grzesiek2010

I looked through the links you sent. I wasn't able to figure out how to make the workaround involving the Relevant feature work, and while I tried looking through the code you sent, I wasn't able to make out what the difference was between my code and what you entered. Do you think you could walk me through what changes you made in you example that are different from the standard repeat?

-Conor

The workaround I mentioned is like in this example: repeat_count_workaround.xlsx (6.8 KB)