URL of experiment: https://gitlab.pavlovia.org/lbdlpsych/tiny
Description of the problem:
This task is a version of a go/no-go task. There are 4 unique stimuli that correspond to four conditions: go/win, go/lose, no-go/win, no-go/lose. The go/no-go refers to whether the optimal response is to press the spacebar or to refrain from pressing the spacebar. The win/lose refers to the feedback – whether the participant is rewarded for their correct response or punished for their incorrect response. These feedback are presented by changing the background color to either green (for correct), yellow (which may be correct or incorrect depending on the condition) or red (for incorrect). The sham variable changes which response is rewarded for the trial for a probabilistic reinforcement proportion of 80/20 (sham = 1: normal, 80% of the time; sham = 2: opposite, 20% of the time).
This is the code (in the code component for the feedback routine in begin routine):
if action == 'go' and reward == 'win':
optimalResp = targetSide
if sham == 1: #high probability trials
if targetPress.keys == optimalResp:
sawOutcome = 0.25
optimalCorrect = 1
yFBvar=0
gFBvar=1
rFBvar=0
else:
sawOutcome = 0
optimalCorrect = 0
yFBvar=1
gFBvar=0
rFBvar=0
else: #low probability trials (sham 2)
if targetPress.keys == optimalResp:
sawOutcome = 0
optimalCorrect = 1
yFBvar=1
gFBvar=0
rFBvar=0
else:
sawOutcome = 0.25
optimalCorrect = 0
yFBvar=0
gFBvar=1
rFBvar=0
if action == 'go' and reward == 'lose':
optimalResp=targetSide
if sham == 1:
if targetPress.keys == optimalResp:
sawOutcome = 0
optimalCorrect = 1
yFBvar=1
gFBvar=0
rFBvar=0
else:
sawOutcome = -0.10
optimalCorrect = 0
yFBvar=0
gFBvar=0
rFBvar=1
else:
if targetPress.keys == optimalResp:
sawOutcome = -0.10
optimalCorrect = 1
yFBvar=0
gFBvar=0
rFBvar=1
else:
sawOutcome = 0
optimalCorrect = 0
yFBvar=1
gFBvar=0
rFBvar=0
if action == 'nogo' and reward == 'win':
optimalResp=None
if sham == 1:
if targetPress.keys == optimalResp:
sawOutcome = 0.25
optimalCorrect = 1
yFBvar=0
gFBvar=1
rFBvar=0
else:
sawOutcome = 0
optimalCorrect = 0
yFBvar=1
gFBvar=0
rFBvar=0
else:
if targetPress.keys == optimalResp:
sawOutcome = 0
optimalCorrect = 1
yFBvar=1
gFBvar=0
rFBvar=0
else:
sawOutcome = 0.25
optimalCorrect = 0
yFBvar=0
gFBvar=1
rFBvar=0
if action == 'nogo' and reward == 'lose':
optimalResp=None
if sham == 1:
if targetPress.keys == optimalResp:
sawOutcome = 0
optimalCorrect = 1
yFBvar=1
gFBvar=0
rFBvar=0
else:
sawOutcome = -0.10
optimalCorrect = 0
yFBvar=0
gFBvar=0
rFBvar=1
else:
if targetPress.keys == optimalResp:
sawOutcome = -0.10
optimalCorrect = 1
yFBvar=0
gFBvar=0
rFBvar=1
else:
sawOutcome = 0
optimalCorrect = 0
yFBvar=1
gFBvar=0
rFBvar=0
targetPress is the name of the keypress (for both practice and real trials). targetSide is always “space” and is defined in a list that is read into the loop. The FBvar is then piped into the opacity of three rectangles that are green, yellow, and red so that only one is made for each trial.
This code works for the actual trials feedback, but for some reason, it is not working on the “go” conditions during the practice trials (the no-go conditions work). In the go conditions, regardless of whether you press the space or not, it gives feedback as if you did not press the space. In the no-go conditions, it gives the correct feedback when you do or don’t press the spacebar, which leads me to believe that it is not a problem with the task not recording the space press. If noteworthy, the sham variable = 1 for every trial in the practice.
It is not a problem with the autotranslate of the word “None.” I manually edited the JS side to translate it to undefined rather than null. I really have no other ideas of what could be wrong, so any guidance would be so appreciated - thanks!