Repeating Instance of Multi-Character Input
I have an experiment where participants complete Task A, but sometimes are interrupted with Task B. After completing Task B, they return to Task A. I have this part all figured out.
When completing Task B, participants need to type their answer (numbers) and have it show up on the screen. I have this part figured out as well (thanks to Sebastiaan's post and code on collecting multi-character inputs).
The problem I'm having (possibly because I'm using Sebastiaan's code and don't know how to rework it) is that Task B has multiple parts, where participants have to do the same thing multiple times (i.e. see a math problem on the screen and type their answer so they can see it). I'm currently unable to make this "repeat" happen. I have attached a screenshot of the trial sequence with just 1 instance of Task B (this works).
I have attempted to copy everything in the red brackets below what is currently there to create a second instance, but it does not run. Only the first instance runs. I do not know if this is the best way to achieve this "repeat", but so far everything I have tried has failed.
Since everything in red is part of Task B, it all runs on "run if" statements in the trial sequence (which works).
I also use Sebastiaan's code at the beginning of the entire experiment for participants to enter a subject number, so this code sequence is used twice with no problem. It only seems to be an issue when I try to place two loops (with the "constants" inline script) right next to each other.