I have a question regarding the begin_repeat type. As shown in the screenshots below, I want to collect data about students in multiple classrooms. In my form, the respondent is asked to input how many students there is in the classroom (t2_teste). My objective is that: if it’s stated that there are 10 students:
The form will not allow more than 10 repeats.
There will be a counter in each repeat (t2_numero_eleve). The counter starts at 1 and means it’s student 1. Then, when the respondent adds a new repeat, the counter will automatically show 2. This is to help them spot which student they are on in case there is a lot of students to report (example: 50).
The screenshots below show what I tried so far, but I couldn’t manage to make anything work yet. I realised that last-saved works between forms and is not used for a repeat group. So how should I proceed?
Create a new calculate question that uses the position(..) function to get the index of the iteration in the repeat-group
Reference that calculate field in a note
A note for future readers: for point two, the calculate has to be below/inside the begin_repeat group and not below/inside any other-sub group. I added it below my begin_group in my first attempt and that did not work, value stayed to 1. I guess that is probably because of the way the function position() evaluates itself.