| Reference | Downloads | Github

Experiment ended without running other routines

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): V3.0.2

Hi all,

My experiment includes two blocks - blockYT and blockNT. The blockYT went on well but the experiment ended (i.e., after 8 trials) without continuing the following routines (i.e., blockNTcode and blockNT). Has anyone ever encountered this problem? and any suggestions for possible reasons? Many thanks.

Hi @Xiaotong, there is not enough information here to easily know what is happening, it would be best if you shared your experiment, so we can see what is happening. If you are able to upload the task to Pavlovia and share the URL, that would be great, else add your Builder file here.

@dvbridges Thanks for your reply! Here’s my builder file. mysound.psyexp (23.6 KB)

@Xiaotong, I imagine there is an error popping up somewhere. I think you either need to reset your study_trial variable back to zero, after the first loop (just add a routine between the loops, and add a code component to reset the variable), or create a new variable to use as the counter in the second loop. If you do not, then you will get an index error in your second loop.

Thank you so much for your suggestions @dvbridges. Yes, I have been receiving this error:

“worditem = word_item1[study_order1[study_trial]]
IndexError: list index out of range” .

I tried the two suggestions but the error persists.

Ok, then if you only want 8 trials to be shown per loop, then you need to set nReps to 1 in both loops, else you will have the same issue.

I set nReps to 2 in loop1 and to 8 in loop 2 and the problem solved! Big thanks! :smile:

1 Like