Randomizaing Loops

System: macOS Version 11.5.1
Psychopy version: v2023.2.3

I am designing a study where participants will be presented with four conditions, and 18 randomized sentences will be presented in each condition.
As shown in the screenshots, I want to randomize the four loops without mixing any conditions within.
In that case, only HigherKey, LowerKey, Instrumental and Control will be randomized, but not the sentences between conditions.

I have three loops here, the most inner one is a loop to show random sentences. The middle loop is a sequential one so that the condition and the blank period afterwards are shown in order. The outer loop is that one I have trouble with, it is set as random with nRep = 2 because I want all four conditions to be repeated twice in random order. Everything works fine except the randomization of the outer loop.

I came across with answers about setting up an excel file with conditions and parameters, but I am confused about that. So I would greater appreciate if someone can help or explain that to me.

I am new to both Psychopy and Python (i’m an undergrad researcher) so thanks for any support in advance!


Hi. You look like you’re very close.

Your outer loop should point to a spreadsheet with three columns and three rows. Each row should have a 1 and two zeros, e.g.
1,0,0
0,1,0
0,0,1

Set the nReps of the three _blank loops as the names of these three columns to have them run in random order.

Thanks for your reply!
I tried doing it but it doesn’t seem to work. Here’s the spreadsheet for the outer loop:

Properties of the outer loop:

Properties of the middle loop:

Properties of the inner loop:

Tons of thanks! Hope I was accurately following your suggestion

That looks correct. In what way is it not working?

Hi, the randomization was off at the first time and it’s all good now! I think it’s because I haven’t refresh the spreadsheet. Tons of thanks!