Free recall task - lists of words

Win10, PsychoPy version 2022.2.5

Hello everybody :slight_smile:
I hope you are doing well.

I’m currently preparing an experiment for a dissertation.
I’m building a free recall task. There will be 3 conditions (positive, negative and neutral emotions)
My participants will have to study in each condition 4 lists of 15 words.
I have a pool of 15 lists of words
I just want to randomise the lists so that my participants will see 4 different list of words in the 3 conditions. (I don’t want to randomise the words, they need to appear in the exact order that i’ve put on my excel file)

I’m searching for solution for days but I didn’t see anything , and I’m new in coding :frowning:

Thank you for your help!!


the following toy-experiment presents numbers from 1-60 in four blocks, 1-15, 16-30, 31-45, 46-60 in random order. Here is the flow

In new block, create a code-component with the following content in the Begin Experiment tab:

useRows = '0:1'
wordList = ['0:15','15:30','30:45','45:60']

I initalize a variable useRows, a list wordList, and shuffle the list wordList.

In the Begin Routine tab insert

useRows = wordList.pop()

This assigns a value of wordList to useRows and deletes the value from the list wordList.

The text-component textNewBlock just shows an asterix to signal a new block. I inserted it for testing purposes. The block-loop is specified as follows:


The text-component in the the trial-routine shows the stimuli, stim, specified in a condition-file called FourLists.xlsx. In the example, stim are integers from 1 to 60. The trial-loop is specified as follows:


The variable useRows specifies which rows are selected from FourLists.xlsx.

Best wishes Jens

Thank you Jens for your quick reply, I will try this!!!

Good morning Jens,

I tried what you suggested but unfortunately it didn’t work

This is my excel file with my list of words, should i change anything ?


what do you mean with

It looks like you arranged your lists in wide format. The apporach I suggested expects the lists in long format.

Best wishes Jens

Is there a way to do the randomisation with wide format or do I need to put in long format ?

many thanks


This is much easier to achieve in the long format than in the wide format. It is some copy&paste work.

Best wishes Jens

Dear Jens

Here is the message error I get :
“‘NoneType’ object is not iterable”

So I believe I have a problem with a variable. Could you kindly me explain me more about useRows and wordList ? I believe I have a problem here

Thank you for your time.


Did you try to rebuild the experiment I describe above?

The error message tells you that you try to iterate an object that is not iterable.

A good source to learn about PsychoPy is: Peirce, J. W., Hirst, R. J. & MacAskill, M. R. (2022). Building Experiments in PsychoPy. 2nd EdnLondon: Sage.

Best wishes Jens

Dear Jens,

I had a mistake in my own wordList variable, I used words instead of numerical values… I did’nt understand properly your explanation, my bad!!!
Everything is now working, thank you so much for your time and your help. Best wishes!