For my experiment participants estimate a point on a graph. I currently have it so that when they click on the graph it displays an ‘x’ where they clicked and then stores the coordinates of the ‘x’. However, I want participants to be able to change their answer if they click on the wrong place on the graph. So, I would like the ‘x’ to move to wherever their most recent click is for each graph image. I would also like only the last place they click per each image to be stored in my data file.
Currently for Begin Routine I have
allText = []
clickN = 'x'
getLoc = None
addText = True
def makeText(clickN):
return visual.TextStim(
win,
text=clickN,
pos=getLoc,
depth=-2.0,
color=[-1,-1,-1],
height=.025)
And for each frame I have
for mouse.isPressedIn(image)
if mouse.isPressedIn(image) and getLoc is None:
getLoc = mouse.getPos()
if not mouse.isPressedIn(image) and getLoc is not None:
allText.append(makeText(clickN))
allText[0].setAutoDraw(True)
clickN = 'x'
getLoc = None