I successfully built my dot-probe task in builder view (without the use of code). However, I am struggling with randomizing the incongruent and congruent trials.
For example, shape, figure, and physique will always be congruent (i.e., the dot-probe will always appear behind these words) whereas, ankle, body, shin will always be incongruent (i.e., no dot probe). I want my dot-probe to be randomly congruent and incongruent (randomly appear behind the target and non-target words) BUT have half congruent and half incongruent trials.
I hope I am explaining this clearly. I have been struggling with this for a little while. A fresh set of eyes on this would be GREAT.
Hey I am struggling with dot probe task on psychopy as well. But I achieved it on psychtoolbox with matlab. You can put all your neutral stimuli and biased stimuli into two different matrixes, then selecting one from each matrix randomly to present in pairs. I’m thinking how to make it work with python code.
I attempted to create code from your demo, but without knowing ANYTHING about code I am a bit lost. I attempted using code, but I keep getting an error message “setting an array element with a sequence.”
As a reminder, I am trying to use independent randomization in a dot probe task. Specifically, trying to randomly present paired word stimuli on the left and right and randomly present the dot probe on the left or right.
here is my attempted code: #begin experiment
positions = [[-0.3, 0], [0.3,0]]
orientation = [0,360] #begin routine
randomIdx=randint(0,2)
posrel=positions[randomIdx]
posirrel=positions[1-randomIdx]
randomIdx=randint(0,2)
orientrel=orientation[randomIdx]
orientirrel=orientation[1-randomIdx]
if orientrel==360:
corrAns=‘left’
else:
corrAns=‘right’
However, I now get both words overlapping and the dot probe always on the left side OR in some trials I get everything on the right. Is there something wrong with the code?
not too sure if I understand the question… but my word pairs, which are constant (slim is always paired with cheer) are overlapping. For example, the first word pair (slim/cheer) is effectively presented on the left and right. then my second word pair (thin/glee) is overlapped (both are being presented on the left). My dot probe is working (its randomly presented on left or right after the word pairs are presented).
and my apologies… I was wrong. it is not every 2nd word pair becoming overlapped. it seems to completely random.
The issue is, I think, that you are generating a new random number for each location instead of generating one number and using 1- that value for the other location.