If this template helps then use it. If not then just delete and start from scratch.
OS (e.g. Win10): OS 10.13.6
PsychoPy version (e.g. 1.84.x): 3.1.5
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?:
Hello everyone, I am making an experiment in Builder that I eventually plan to put online with Pavlovia, but I am running into the issue of having trouble counterbalancing my experiment. I am relatively new to PsychoPy and unsure of how to proceed.
My experiment is a word learning experiment. The only instructions to the participant are to observe and remember the word pairs that appear to them on the screen. Let me describe it:
I will be presenting word pairs on the screen (a known word, and a foreign word). For half of the participants, the foreign word should appear on the right during the whole experiment, and for the other half, on the left. For this I have put a field in the āExperiment Infoā in order to select an āAā or āBā set, which reflects which side the stimuli appear on, and I then have 2 different excel sheets, A and B for my stim which in turn have $word1 or $word2 linked in the text component part, and it is working well. However, the next part is not so straightforward
I have 60 word pairs, which I want to present in 3 learning blocks: In one block, a monochromatic tone will play with the words, in another a natural sound, and in the third there will be silence when the words are presented. These blocks should be shuffled before starting the experiment. Also, I want to program the experiment in a way that the known and foreign word pairs are matched together in a random way for each participant. However, I need to write a part of the code saying that if the known word and the foreign word start with the same phoneme, they are NOT to be paired together.
What I want to ideally do is to shuffle my list of stimuli and my blocks at the beginning of the experiment. After shuffling, if the first block selected is a tone block, then the following 20 stimuli will be presented along with a monochromatic tone, and the second block will present the next 20 stimuli with a sound, and the final without sound (or vice versa).
While my natural sounds are linked explicitly to my known words (i.e., bird ā bird sounds), I have 20 monochromatic tones which should be shuffled and linked to word pairs in a random way during the tone block.
Additionally, each block must contain an equal number of ānaturalā (i.e. rain) versus āartificialā stim words (i.e. a car horn). I am wondering if I can do all these counterbalancing measures in 1 excel sheet or if I need multipleā¦Iāve been looking at the following thread Random selection of image stimuli without repetition across different blocks as I work on my answer, but I find myself fumbling quite a bit. Hopefully my explanation makes sense. If anyone has advice or has done something similar, please let me know, and I am very grateful for the advice!!
What did you try to make it work?:
This is some code I have tried to put into the āBegin Experimentā code component.
# create different lists
spanWordsNA = ['spanStimNA.xlsx']
spanWordsAR = ['spanStimAR.xlsx']
vimmiWords = ['vimStim.xlsx']
monochromTones = ['tonesStim.xlsx']
# randomize list orders
shuffle(spanWordsNA)
shuffle(spanWordsAR)
shuffle(vimmiWords)
shuffle(monochromTones)
# get now-randomised selections of each for each block:
soundBlock_files = spanWordsNA[0:10] + spanWordsAR[0:10] + vimmiWords[0:20]
toneBlock_files = spanWordsNA[10:20] + spanWordsAR[10:20] + vimmiWords[20:40] + monochromTones[0:20]
silenceBlock_files = spanWordsNA[40:60] + spanWordsAR[40:60] + vimmiWords[40:60]
# randomly intersperse files in blocks:
shuffle(soundBlock_files)
shuffle(toneBlock_files)
shuffle(silenceBlock_files)
What specifically went wrong when you tried that?:
I have having trouble specifically linking the different excel sheets I made to one routine (maybe that isnāt possible?). I have one routine, surrounded by 2 loops. In the inner loop I have the condition linked to $Excels and on the outside loop I have the conditions linked to my excel sheet called all.xlsx, which contains the other excel sheets spanStimAR.xlsx, spanStimNA.xlsx, vimStim.xlsx,
keyword1.setText(Word1)
NameError: name āWord1ā is not defined
This is the error I get, so obviously my excel sheets are not being read correctly.