Looping outside loop

Hi All,

Am working on a script which is to be done in several loops outside each other in a household.
The scenario is I will get a list of household members and their kids(whatever no their are) and based on this I now start going through the 1st level of loops asking about each household member and their activities.I have a question asking them number of subjects the kids learn in school and from this I will do another second loop(outside the 1st) for each child in the household for the number of subjects done in school and in each subject the topics covered and after this another loop(outside the 1st and 2nd) asking for the topics covered and this will contiue a number of times with the loop becoming more and more.
The approach I have used is the long road of single questions and but its beoming quite the maze right now.

I would like to use the loop approach but am not sure how
1-I will do a count inside a loop to set in motion based on a count of total how many times the second loop will be asked per child eg

Loop 1
child 1: 2 subjects,
child 2: 3 subjects
child3:1 subject thus 6 subjects

Loop 2
child1 to be asked 2 subjects the topics covered per subject eg 4 and 3
child2 to be asked 3 subjects the topics covered per subject eg 2 and 1 and 2
child3 to be asked 1 subjects the topics covered per subject eg 3

Loop 3

Child1>1>4 and Child1>2>3
Child2>1>2 and Child2>2>1 and Child2>3>2
Child3>1>3

2-how do I pull in the names of the kids>subject>topic as I more and more into these loops outside each other.

Regards,

PN

@PN, I'd recommend you start with a very simple form with one or two questions and the repeating structure you think might work. Share that and we can help improve it.

https://docs.opendatakit.org/form-repeats will also be helpful to review.