# Block Design Experiment

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10):
PsychoPy version (v2023.2.3)

What are you trying to achieve?:
I’m trying to build a block design experiment. I need 30 blocks, 10 of each condition (negative_visualize, negative_reappraise and neutral).

What did you try to make it work?:

I used this code:

``````useRows = []
instruction = []
trigger = []

blockTypes = [1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3]

neutral = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]
shuffle(neutral)
negative = [30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89]
shuffle(negative)

for Idx in range(10):
shuffle(blockTypes)
for Jdx in range(3):
if blockTypes[Jdx] == 1:
useRows.append(negative.pop())
instruction.append("Visualizar")
trigger.append(18)
for Jdx in range(3):
if blockTypes[Jdx] == 2:
useRows.append(negative.pop())
instruction.append("Reavaliar")
trigger.append(20)
for Jdx in range(3):
if blockTypes[Jdx] == 3:
useRows.append(neutral.pop())
instruction.append("Visualizar")
trigger.append(24)

print(useRows)
``````

This is the loop reference:

And the instruction reference:

What specifically went wrong when you tried that?:
The experiment is showing only 1 image of each condition and going to the next condition. I need it to show 3 images of the same condition in a row.

Hello

you certainly does not want to set the instruction in every frame but rather every repeat. This does not address your question concerning the block-design which I tried to answer here