Dot-probe task; Randomizing Congruent and Incongruent Trials

Hello,

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.

I would really appreciate any advice!

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. :pensive:

Hi again!

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’

and here is what I put in builder view;

I would appreciate any advice!

In your component you are using orientation (your list) rather than your chosen orientation? Possibly similar with position

Thank you for your response,

I fixed the error message “setting an array element with a sequence” by inputting this into the builder view;

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?

randint(0,1) is always 0 I think.

Personally I always put that kind of code in a code component, so it can work online too.

You mean in builder view?


error message;

but if I put;

it works but every 2nd word pair becomes overlapped… is there a way to fix this?

What combinations of values are overlapping?

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.

That would make sense… do you have any ideas on how to approach this issue?
I really appreciate all your time on this!

You’ve already posted my suggested method.

You were right! There was nothing wrong with the code…it was what I was putting in builder view.
So my fix was;

For word 1
(posirel[0],0)
orientrel

for word 2
(posirrel[0],0)
orientirrel

then for my dot probe I just used my conditions file to randomize the location.

it all seems to work offline…but when I try to upload it to Pavlovia I get a reference error

reference error: can’t find variable: randint

I read a thread about reference error but I cant seem to fix it. Any suggestions?

Thank you!