How to repeat incorrect trials only

I’m not entirely sure this will be possible in Builder with a random loop, but a possible route to investigate would be

  • controlling the selected rows field of the inner loop. In the first run through, all rows would be selected but afterwards, you would just select the subset of desired rows where the response was incorrect.

I’m just not sure that would really work, because if the loop is randomised, the row numbers might not correspond any more on a subsequent loop. So perhaps this would be an alternative:

  • In your conditions file, include a column number with a unique identifier per row (it could just be sequential numbers 1,2,3,…), let’s say that column is called row_id
  • At the beginning of the routine, on the very first trial (when the iteration number of both loops is zero), initialise a list like this:
if outer_loop_name.thisN == 0 and inner_loop_name.thisN == 0:
    wrong_list = []
  • On each incorrect trial, add the unique id to that list, like this:
if outer_loop_name.thisN == 0 and blah blah: # where blah blah is your check that the response was incorrect
    wrong_list.append(row_id)

Then also include some code like this in the "begin routine " tab for running in the second pass through the loop:

# one the second run through the loop, only run a trial if it was previously
# recorded as incorrect:
if outer_loop_name.thisN == 1:
    if row_id is not in wrong_list:
        continueRoutine = False

The above is just a sketch of what to do, and would need to be extended if there could be additional runs until the loop is completely perfectly.

1 Like