PsychoPy version: v2024.2.4
What are you trying to achieve?:
The goal is to skip the upcoming routine in the task if there is a certain response given in the current routine. For eg. the question states that do you think the two games were same or different – if the participant answers “same” (by giving a touch response to an image displaying the word “same”), the task should skip the remaining routines and directly show the end routine. However, if the participant answers “different”, the task should move on to the next routine.
In the above picture, if the response in the routine “Task_Monitoring1” is “same” (which is a image response), the task should move on to the “end” routine. However, if the response is “different”, it should move on to TM2 routine.
What did you try to make it work?:
I tried to put the following code in Each Frame of Task_Monitoring1 routine
mouseloc = mouse.getPos()
if mouseloc[0] == mouserec[0] and mouseloc[1] == mouserec[1]:
pass
elif same_image.contains(mouse):
if t > minRT:
mouserec = mouseloc
mousetime= core.getTime()
respMade = 1
Task_Mon1_ans = True
thisExp.addData('Task_Mon1_resp', same_image.name)
continueRoutine = False
else:
mouserec = mouse.getPos()
elif diff_image.contains(mouse):
if t > minRT:
mouserec = mouseloc
mousetime= core.getTime()
respMade = 1
Task_Mon1_ans = False
thisExp.addData('Task_Mon1_resp', diff_image.name)
continueRoutine = False
else:
mouserec = mouse.getPos()
and then the variable Task_Mon1_ans was put in the skipif of the TM2 routine
The code or the placement of the code doesnt seem to work here.
Please help me identify the issue here.
Thanks