Breaking a loop in PsychoPy based on the number of elements in an Excel list

15 Views Asked by At

I'm using PsychoPy to run an experiment on auditory repetition, however, I'm a bit stuck when it comes to programming a stop to a loop. What I'm trying to accomplish is the following: the participant gets assigned at random a list of stimuli, and then they are presented at random the stimuli inside the list. In PsychoPy, I have created an outer loop that looks at 9 Excel lists (block1, block2 ... block3) and an inner loop that looks inside the list and randomizes the items. At the moment, the outer loop randomizes the lists, however it does not stop at a single list, it keeps going until all the lists are exhausted. I want only a single list to be assigned at random, and then to stop once all the items in that list are exhausted. As such, I am looking for a way to code a stop to the trial once all items in said trial are exhausted. One important thing to note is that one list in particular has more stimuli than all the other lists.

Any hints are appreciated, I am a a newbie to programming and this quite beats me at the moment. Tried Googling what to do but all the solutions are in regards to stopping the loop whenever the participants presses a key, not when all the items in a list are exhausted.

0

There are 0 best solutions below