I have to pick up the count of boys and girls in classes 1 to 10.
A bad way of doing is that I have created a group with one label saying CLASS 1, and then 2 text-inputs saying to enter total number of boys and girls in that class (class 1 in this case). Then I am copy-pasting the same group 10 times and changing the class number + count variables to new class number. But this is bad programming, I know!
I need some help in putting the one group I create into a repeat loop, and modifying label as well as count variable names according to the class number for that loop. I can modify the label, but how to change the variable names to reflect class number w.r.t the repeat loop count?
A repeat group will send the data to a second table. In the below case you would have your submission table and then your class_repeat table. For each row in your submission table, you would have 10 rows in your class_repeat table.
This seems the logical solution. However, when I put in a text type element and try to set its name to any of the variables calculated above, the compiling does not go happy!
Error: [row : 33] Invalid question name [${class_name}] Names must begin with a letter, colon, or underscore.Subsequent characters can include numbers, dashes, and periods.
OK I guess I got the point. There is no need for different variable names, since it is not into flat hierarchy and looped data is going into a separate group.