psychopy.org | Reference | Downloads | Github

Randomization of stimuli positions

randomization

#1

Hi, fellows…

I’m trying to figure out how to present two comparison stimuli randomly, at the corners of the computer screen, as well. However, I’m using the mouse component to collect the participants’ responses. I used the excel grids to specify the correct responses(see req_response in the code below). In addition I used the following statements to register whether the participants’ response in a give trial was correct or incorrct:

if mouse_resp_fdn.clicked_name[0] == req_response:
…total_correct += 1
…som.setVolume(1)
else:
…som.setVolume(0)
thisExp.addData (‘total_correct’, total_correct)

This is working pretty well now that comparison stimuli are presented randomly at the bottom-left and bottom-right corners of the screen. Do I need to do any modifications here to achieve the same goal with comparisons presented randomly at the four corners?

Best,


#2

Hi @Marcelo_Silveira, giving us a clear methodology for your task would help us to guide you a bit better. For now, it seems like you would just like to add two more locations to randomly present your stimuli. You could create a list of positions at the beginning of each routine, shuffle the list, and use these randomized positions for your stim. E.g.,

# Begin routine
locs = [posA, posB, posC, posD]  # Where posA etc are defined as your stim locations
shuffle(locs)

Then in each of your stim components, set the positions for your four stim using the new locs variable. E.g., in Builder, add one of locs[0], locs[1], etc for each of your four stim.


#3

Hi,
I’m sorry if I had fallen short. I’ll try to be more clear about my methodology.

This is a 2-choice MTS procecure. A trial start with a sample stimulus at the center of the screen (0,0 coordinates). Then, the participant must move the mouse cursor to sample and click on it. This click causes the presentation of two comparison stimuli at two positons: left-bottom and right-bottom sides of the screen (-0.6, -0.4 and 0.6, -0.4, respectively). One of these comparisons is the correct one and everytime the participant click on it, the program provides an auditory feedback. After the feedback, a new trial begin with the sample and the same observing response requirement. However, the comparison stimuli are now presented in new locations: left-up and right-up (-0.6, 0.4 and 0.6, 0.4, respectively). The same contingency for feedback is applyed here too.
Now, what I do need is to vary the positions of the comparison stimuli randomly, trial by trial and unpredictably.
Probably, this list must include several coordinates instead of strings like ‘posA’, right?
In addition, I must be very sure that the program is registering the correct responses and the incorrect responses as well. I can show you the builder/codes of my procedure if you think this is helpful. Can I do it via discourse?

Thanks for helping me up!


#4

@Marcelo_Silveira, just for info, posA would not be a string, it would be a variable holding locations. However, that suggestion will not be appropriate given the new information. Do you want to have equal numbers of trials where stimuli are presented at the upper and lower areas of the screen i.e., counterbalanced? If so, you can set your screen positions in a conditions file (i.e., upper or lower) and have them presented randomly using the trialhander. In the attached example, two shapes are presented at the upper or lower parts of the screen at random, determined by the randomisation of the screenPos variable in the conditions file. The upper and lower (x, y) stim positions are defined in a code component at the beginning of the experiment, and are used to set the stimuli positions depending on whether the screenPos variable in the conditions file is “upper” or “lower”. If this is the design you would like, you could easily put those changes into your experiment. However, let me know if you have any problems.

stimList.xlsx (7.8 KB)
randomLocs.psyexp (8.8 KB)


#5

Hi, David. I’m sorry for the slow response.

This seems to be suitable for me…I’ll take a look at this in the follwoing days. I’ll keep you posted about!

Thank you very much,
Marcelo.


#6

By the way…I can use the shuffle fuction to randomise the positions in the begin routine code, right?


#7

Yes, use shuffle you want to the left and right positions to also be randomized for the upper and lower variable positions. Note, you will have to convert the tuples to lists, e.g.,:

lowerPos = [[-0.5, -.5], [0.5, -.5]]

#8

Hi, David.

I did some changes into your experiment and it worked out for the rectangles (take a look). However, It is not working for my matching-to-sample task. As far as I understood, the issue is related to the fact that I’m using two figure component. testrandomLocs.psyexp (9.6 KB)


#9

Here the stimFilestimList.xlsx (8.1 KB)


#10

Here areABCDE_Full.psyexp (112.9 KB)
Teste_Eq.xlsx (9.0 KB)
Teste_Tr.xlsx (9.0 KB)
Treino_Misto.xlsx (10.1 KB)
TreinoAB.xlsx (9.1 KB)
TreinoABfdn.xlsx (9.1 KB)
TreinoAC.xlsx (9.1 KB)
TreinoACfdn.xlsx (9.1 KB)
TreinoAD.xlsx (9.1 KB)
TreinoADfdn.xlsx (9.1 KB)
TreinoAE.xlsx (9.1 KB)
TreinoAEfdn.xlsx (9.1 KB)
my files and builder that I’ve been using to construct the 2 choice MTS task.


#11

@Marcelo_Silveira, what is the problem you are having?


#12

Here it is!

2018-10-17|690x387