Reseting stimuli to original location in next trial

Hi, I have an experiment in which I use a code that allows stimuli to be clicked on and dragged anywhere. I want my participants to do this task multiple times; twice in one trial and in multiple trials. The problem is after the objects are moved once, in the next trials they stay in the previously dragged place. I want them to reset to the original place (top of the screen) so that participants can click and drag them again.
As can be seen in the first screenshot, “placement” routine is the one the click and drag task is done. The code I used in that routine to make objects move can be seen in the next screenshots.
In one trial there are two placement tasks. I tried using the same routine and a different routine with the same code for the second placement task. However, both didn’t work the way I need. I think adding a code that resets stimuli to certain locations can work but I don’t know coding language so I couldn’t get it right :frowning:
I’d appreciate it a lot if anyone can help me! Thank you in advance!

image
image
image

image
FS2-A.psyexp (191.0 KB)
FS2-A_lastrun.py (143.3 KB)

Since you already defined a list of the positions in “Begin experiment” like so

positions = [
  (-0.33,0.35), 
  (-0.11,0.35), 
  (0.11, 0.35), 
  (0.33, 0.35)
]

you should be able to say

P1.pos = positions[1]
P2.pos = positions[2]
P3.pos = positions[3]
P4.pos = positions[4]

in “Begin routine” to reset the position of your images.

It worked! I had to change the values to 0,1,2,3 to avoid a list index out-of-range error.
Thank you so much!

Ah, right! Sorry, this was the R-side of my brain writing :smiley: Great, that you figured it out! :+1:

1 Like