| Reference | Downloads | Github

Avoiding 2 rows per trial in the data output when having nested loops

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10):
PsychoPy version (e.g. 1.84.x): 3.2020
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?: Trying to avoid that the output reports an extra row with the details of the outer loop

What did you try to make it work?: I tried to check the toggle “isTrial” only in the inner loop and not on the outer loop

What specifically went wrong when you tried that?: It keeps reporting both rows x trial

Indeed I have a trial Routine with an inner and Outer loop. The inner loop refers to a variable called $ImgList . Such variable refers to a further variable into the file “block.xlsx”. Within such block file the ImgList recalls several other .csv files corresponding to a list of stimuli each tied to a certain experimental condition.

What I do in the script is that every trial I enter the inner loop, pick one image from this big pool then break out of the loop. So the trial level is actually controlled by the outer loop while the inner loop only make sure that a random image from this large pool of images belonging to each condition is taken.

The output appears to be as follows:

as you can see it shows the inner loop where the response has been collected and then an additional line with the details coming from the outer loop but that belong all to the previous trial.
Is there a way to avoid that and have one line per trial? Note that I tried already to check the IsTrial box for the outer loop and not for the inner loop or for both but that did not make any difference. :frowning:

Here the example of the script that I use and of my listsBE_NEW.psyexp (25.0 KB) (25.7 KB) block.xlsx (9.9 KB) close_close_garden.xlsx (10.5 KB)

Thanks for all the help!!!

Any Suggestion :)??

Thanks a lot,