| Reference | Downloads | Github

Multiple and different blocks

OS: Windows 10
PsychoPy version: 2020.2.4
What are you trying to achieve?:
I am very new to PsychoPy and coding. I have a task where participants will see 40 emotional images twice. When they see an image they either have to decide what emotion is expressed by the person from 4 possible options or to what degree they can emphasize with the person (9-point likert scale), so it’s basically two tasks in one experiment.

I have managed to set up the two tasks separately with a break after every 10 trials. But at this point they would first do the emotion recognition task for all images and the empathy task for all 40 images. What I would like is to swap back and forth between the two task for every block of 10 images.

My problem is that even though the image stimuli are the same the response type and text sounding the images differ for each task.

If I have to create an individual trial for each block of 10 images is there a way that I can ensure that the order or the images presents is still randomized across each task of 40 images ?

Hm… Are there any constraints in terms of the order of stimuli? If the lists are randomised independently, for a given image it could happen that participants are asked about the expressed emotion in trial 1 and about empathy in trial 80. However, it could also happen that they’re asked about empathy in trial 20 and about the expressed emotion in trial 21. Would this be a problem?


Hi Jane thanks for getting back to me.
I would like to have blocks of 10 images of the same task but the swap between the empathy and emotion task for each block. So block 1, 3, 5, 7 should be the emotion rec task and block 2, 4, 6, 8 the empathy task.
I hope this makes sense.

@Miriam21: It does, but it doesn’t answer the question if there should be any constraints placed on the randomisation of the images themselves. To give another example, if participants are asked about the expression of images 28, 39, 21, 9, 14, 16, 31, 22, 17 and 2 in block 1, should they be asked about empathy for these same images (and in the same order?) in block 2? Or can it be other images?


Ah that makes sense. No they should be completely random.

@Miriam21: OK, that should make things easier. Could you perhaps show us the components in the routines you use for displaying the images and what your input files look like? You could either add screenshots or upload your .psyexp and input files. I’m trying to understand if it would be possible to use the same routine in both tasks or if separate routines are required.


I put what I got so far on GitHub GitHub - MiriamSchaepers/MET
Is that okay?
I can’t use the original images due to copyright so its just bunch of images of my cat.

Hi @Miriam21,

Please find a minimal working example attached. It uses just text components to simplify things, but the basic idea would be the same for your experiment. The experiment starts out by reading the input files (as described in @wakecarter’s Interleaved Lists crib sheet section). It then presents 10 “emotion” trials (letters in the example), 10 “empathy” trials (numbers), and repeats this once (the current input files have only 20 trials; you would need to adjust the nReps for blockLoop to 4).

The list that is used for the emotion trials is called emos. To display the correct stimulus on a given trial, a counter is used (emoCount). For example, the Text in the emoText component is $emos[emoCount][0]. The response component uses $emos[emoCount][1] to determine if the answer was correct. The numbers in square brackets are based on the order of columns in your input file (i.e., in the example the stimuli are in the first column of the input file, the correct answers in the second column). You will need to adjust these numbers based on the columns in your input file.

Hope this helps.


emo_empath_blocks.psyexp (20.9 KB)
input1.xlsx (8.8 KB)
input2.xlsx (8.6 KB)


Thank you so much Jane it’s working perfectly!