Randomising block of rows in excel in a loop

What are you trying to achieve?:
I have to present a series of videos in blocks. So, I have made an excel sheet with a list of how I would like the stimuli to be presented, and am using it as the conditions file in the loop around my routine.

So, as it can be seen from the above figure, I need the first block, i.e., HPF to play all its files and move over to the next block. What I would like to do is to randomise the order of the whole block, i.e., for participant 1, the order could be HPF, NF and LPF and for the 2nd participant NF, HPF and LPF and so on. basically to randomise the blocks.
How do I do that using the loop properties? Can anyone please guide me?
I am attaching a picture of the loop properties along with the flow.

Thanks so much.

The easiest way is to have an outer loop pointing to a spreadsheet with a column called useRows containing 0:3, 3:6 & 6:9

Outer loop around which routine(s)? And should this looptype be set to random?

I’m terribly sorry for the inconvenience but I’m working with psychopy for the first time.

What is currently in your randomiser?

What is the difference between blocks 1, 2 & 3?

It might be that you need this separately around loop1, loop2 and loop3 if you want all block1 versions to appear next to each other.

The randomiser is to randomise the order of the routines themselves (i.e., block 1, 2 and 3).
The difference between the blocks is nothing much except that they have different stimuli that needs to appear one after the other. So in the experiment, I have 140 videos that need to appear in one block.
I have made an order of the kind of stimuli that I want to appear in the excel file in loop 1, 2 and 3.
But what I want is to randomise the blocks that i have created in the excel file, without changing the order of the individual trial themselves.

I tried to have a loop outside loop 1, 2 and 3 but it doesn’t really work.

That looks right. Did you put useRows as the selected rows of the inner loops? The outer loops don’t need ‘is trials’ to be ticked.

No, I didn’t. Should I put useRows in the selected rows of the outer1, 2 and 3? or the loop1, 2 and 3?

loop1, 2, & 3 because they have nine rows and you want them to repeat three times selecting just three rows each time.

If I do that, it does not run on psychopy and shows the following error on pavlovia:


What does outer.xlsx look like?

this is what it looks like

That looks like its been formatted as a time (which is why it thinks it’s a number). It needs to be a string so try “0:3” “3:6” and “6:9”

It shows the same error.
Here are the loop conditions of all the loops and the excel files.

Try $useRows as the selected rows. I’ve just noticed that there isn’t a $ already to the left of the box (which is the normal rule, though it does have exceptions)

So what is happening is that the first loop plays the blocks (mentioned in loop1,2,3) one after the other, after which the first two blocks within the loop plays another time before moving on to the next loop.

I want the individual blocks (within the loop1,2,3 excels) to appear only once and in a random order.
i.e., i want the 9 rows to appear only once selecting three rows at a time and in a random order.

Loop1 etc shouldn’t be sequential.

Even after doing that, the order of the trials are all mixed up. The order of the trials within the blocks is not maintained and some trials are getting repeated.

I set loop1 etc to random.

So you do want loop1 to be sequential? My understanding was that you have three levels of randomisation – Excel file/block - set of three rows – within set of three rows.

I’m not sure how to explain how I want loop1 to be.
The excel file part of loop1 has 9 rows, where each row corresponds to a trial. Three rows correspond to a block.
I want the order of the blocks to be randomised. For example, row1,2,3 then row7,8,9 followed by 4,5,6. Or 4,5,6 then 1,2,3 and so on.
I need to maintain this because these three rows correspond to one variable and I need them to be together.

Ok, so loop1 was correct to be sequential