| Reference | Downloads | Github

Main loop playing sub loops randomly

MacOS Sierra

Hello PsychoPy community!

I’m currently working with the builder to build the framework for my experiment to later gradually finetune things with the coder.
I have read through many threads and still could not find a working solution for my issue. My experiment consists of a main loop that is supposed to repeat 12times and while initiated six sub loops in a random order. So far, the main loop always crashes after one full run with an index error ("line 853, in
WordVisual = WordV_item[WordV_order[WordV_trial]]
IndexError: list index out of range).
I cannot figure out why this is happening and how to solve this issue. Also, the main loop is not playing the sub loops in a random order, although it is supposed to and its TrialHandler says so. Is there a way to make this work in the Builder or does this have to be handled in the coder?

Any help is appreciated very much as I’m new to PsychoPy (also coding solutions are warmly welcomed)!

Have a great day!
Testing.psyexp (54.4 KB) AStimuli.xlsx (11.1 KB) VStimuli.xlsx (7.4 KB)

I read your thread and I wanted to know if you could find a solution to playing loops in random? I have the same problem and loops in my psychopy file are presented sequential not random, however I’ve set the outer loop’s LoopType in random. and I don’t know what to do!

I haven’t looked at your flow (I’m on my phone) but an outer loop can be used to repeat an inner loop using parameters in a random order. It won’t randomise the order of multiple different sub loops.

Hey there!
I decided to switch to Coder to solve this problem. There I have solved it by defining different functions and creating a list of these functions that I shuffled randomly and then the main loop iterated through the list for the desired number of times (the list was shuffled after each full loop again).

If you need it, I can surely share some of my code but keep in mind that I’m just a beginner in programming!

Best wishes!

Thanks for your reply. Yes, if it’s ok for you, I’d like to take a look at it.