On every trial a person should get a random word along with a random image.
The twist is that I would like to go through all four words once, and only then present each word a second time. So, for example, the words presented on each trial might look like this:
T1: cat
T2: dog
T3: tree
T4: sky
T5: dog
T6: sky
T7: cat
T8: tree
How I’ve thought to do this would be to just create an object that is the four words randomized once, and then attached to the four words randomized again. And then to call from this object on each trial. In terms of images, I figure I will just use a condition file.
Does this make sense? Could anyone point me to a resource for creating a list of items on the go in PsychoPy?
I do this kind of thing quite often. Have a look at my Independent Randomisation online demo. You could sent the first loop up with nReps = 2 to create the list you want.
It should be $finalstim (check your spelling) set every repeat.
finalstim = stims.pop() should be in Begin Routine in a code component above the text component. In general, put code components first in a routine (unless you have a specific reason to do otherwise).
You’re very welcome. I’m glad the code is working for you.
I’ve been helping people as a hobby since lockdown started (because I needed to learn myself and have become an expert on the quirks of moving PsychoPy experiments online using the auto translate tool). Today is my first official day of employment as a part-time Science Officer for Open Science Tools.
This was working nicely on my computer, but when I tried to run it on Pavlovia I got the following error:
Unfortunately we encountered the following error:
when setting the image of ImageStim: image
when getting the value of resource: Pair1_RL_G.png
unknown resource
Try to run the experiment again. If the error persists, contact the experiment designer.
Note that this is for the images I’m presenting, which are set up in a simpler way than the words you helped me with above. There are simply eight images, and they get shuffled at the start of the experiment like this:
I have a follow up for this experiment. It is working well, but the output doesn’t list the stimuli that were presented on a given trial. Is there a way to have it do this?
For reference, I randomize the list of images at the start of the experiment like this: