enketo-core icon indicating copy to clipboard operation
enketo-core copied to clipboard

[Nested repeats] all the child questions in new repeat instance are not auto generated when this repeat is the grand grand son of a root repeat after specified steps

Open nanzhang01 opened this issue 3 years ago • 2 comments

Describe the bug All the child questions in new repeat instance are not auto generated when this repeat is the grand grand son of a root repeat after specified steps.

To Reproduce

  1. Create a xls form, add a repeat question(repeat A).
  2. Add a text question and a repeat question(repeat B) into repeat A.
  3. Add a text question and a repeat question(repeat C) into repeat B.
  4. Add a text question and a repeat question(repeat D) into repeat C. Add a text question into repeat D, set a constraint expression for this text question(eg: string-length(.)<=10).
  5. Publish the survey, open it in enketo app. By default, the first instance of repeat A is existing.
  6. Click the add(+) button of repeat B or repeat C. Observe, the new repeat instance generated correctly.
  7. Click the add(+) button of repeat A, Observe, in the new repeat instance, the repeat D is not generated.
  8. Click the add(+) button of repeat D to add a instance manually,
  9. Validate the form, an error occurs, it says: Form contains errors. Please see fields marked in red..

Expected behavior

  • In the step 7, default instance of repeat D can be generated automatically.
  • The validation of step 9 works normally.

Screenshots and attachments xls form:

issues on nested repeat when the repeats level is greate than 3.xlsx

image

enketo app:

bug_screenshot1234

After step 7, the repeat D instance is not generated in the model: image

Error info: image

nanzhang01 avatar Jul 21 '20 03:07 nanzhang01

Thanks @nanzhang01,

Excellent issue report. I won't be working on nested repeat issues myself, but a PR is welcome.

MartijnR avatar Jul 22 '20 15:07 MartijnR

might be duplicate of #804

MartijnR avatar Oct 19 '21 20:10 MartijnR