Reuse loops in builder

Is there an easy way to reuse loops in the builder (rather than simply redraw it…)?

Thanks!

Hi,

what do you mean with “reuse”? If you want to have the same loop runs more than 1 time you could simply increase the number of repetition. If you want to add different blocks that have similar structurest you can add a second loop above the first one (but i suggest you search for a tutorial on how to do a block desing using the builder).

tandy

By “reuse” - well, for instance, I’d like to do a few blocks of practice before the testing. Now, the blocks of the training and the testing are identical (often not, but in my case they are). So it’s basically, put a “this is practice, press any key when ready” screen, do a few repetitions over a loop, put a screen “Now it’s testing time, take a few deep breaths and press any key to go!*” and do a number of repetitions over an identical loop. - though it’s a bit awkward I think.

Probably the best solution is to do nested loops when the outer loop shows once the practice image and once the testing image as the start window, and the number of repetitions of the inner loop is changed by the start window

  • I’ve made the sentences now, it definitely can be put better…

I have two different methods for practice trials.

  1. I have two loop around copies of the same routines. Depending on the experiment, the practice loop either has fewer reps, uses specific rows, points to a different spreadsheet (rarely) or has an extra routine which ends the loop after the desired number of reps. The pre practice and pre trials instructions sit outside the loops.

  2. Everything is in one loop (or two concentric loops). The instructions routine is displayed at dthe desired times by checking the value of a loop index variable (e.g. loopIdx) which is incremental at the end of each trial.

To follow on from the other suggestions, the outer, block-level loop can be connected to a conditions file that contains the instruction text in one of its columns. i.e. the first cell in that column contains the instructions for the practice block, and the second contains the instructions for the test block. The instruction routine has a text stimulus which displays the contents of that variable. The instruction routine should be nested within the outer loop only (i.e. not inside the inner, trial-level loop). That way you get what you want without any need for custom code (the outer loop must be set to run sequentially rather than randomly). This also allows you to specify different conditions files for the practice and test blocks.

1 Like