Presenting three loops at random

Hi everybody. I have three loops within another loop and I want to present these three loops at random (I want all three to be presented but at random).LearningSound.psyexp (40.0 KB)
I just now tried the code for the auditory part but it doesn’t present all three loops. It just select one of three loops and presents it three times.
I appreciate it a lot if you could guide me on how to present three loops at random.

Ah I see the problem, you’ve put all of the code for choosing a loop in the Begin Experiment tab - meaning it runs once at the start of the experiment. If you keep rand=[1,2,3] in that tab and move everything else to the Begin Routine tab it should work!

Hi, thanks for your reply. I did so but it still doesn’t play them at random order. It just play one of them three times!

Just realised, you also need to remove the for loop! The code in the Begin Routine tab will run every repeat, so you don’t need to run it in another for loop - doing so essentially just sets randnum to the final value it chooses and keeps it there.

I’m sorry! I removed the loop but now what it does is choosing one of the three loops in the auditory part and play it once and then go to visual part. So I don’t have the other two parts of the auditory portion.

I think now that there’s no for loop you do need repeats to be 3, that way it should do the choice 3 times, with previous options eliminated each time!

Sorry, I didn’t get what you said. What repeats you mean?
Because the for loop in my code repeats three times. And I removed the loop with nReps of 3.

The nReps of 3 is what I mean, I think you can put it back now and it should fix it

But it was there in the first place and our problem what repeating one part for three times not presenting three parts at random.

But it was doing that because of these other problems causing it to choose the same number three times, now that these problems are solved you should be able to set nReps back to 3 now