Issues with staircase in stop signal task

Hi everyone,
I am trying to set a stop signal experiment where the stop signal delay (SSD) wiil use a staircase going up and down between 50ms and 1.25ms depending weather the answer is correct or not (longer delay when answer is right and shorter delay when wrong) for some resons my keyboard responds are regesitering as incorrect even when they are correct. for example If i wont touch the keyboard then it should say corect stops and incorrect goes but it says incorrect stops and sometimes correct go. any ideas? (hope my qustion was undersatndable)

#begin experiment tab
duration_time = 0.050
start_time = 0.250

#begin routine tab
if sound_yes_no == 1:
    duration_time = .05

#end routine tab
# if anser is correct and smaller then maximum ssd level( 1.150)

if ((key_resp.corr == 1) and (sound_yes_no == 1)and (start_time < 1.150)):
    start_time = start_time + .050
    print (start_time)
    print ('correct stop')
    print ('ssd should be larger in .050 compared to last ssd')


#if answer is correct but reached maximum level
elif ((key_resp.corr == 1) and (sound_yes_no == 1) and (start_time >= 1.150)):
    start_time = start_time 
    print (start_time)
    print ('correct stop')
    print ('you reached maximum level')
    print ('ssd should stay the same to last ssd')


# if anser is incorrect and larger then minmum  ssd level(.050)
elif ((key_resp.corr == 0) and (sound_yes_no == 1) and (start_time > .051)):
    start_time = start_time - .050
    print (start_time)
    print ('incorrect stop')
    print ('ssd should be smaller in .050 compared to last ssd')

#  ssd reached minimum level
elif (key_resp.corr == 0 and sound_yes_no == 1 and start_time <= .051):
    start_time = start_time + 0.00
    print (start_time)
    print ('incorrect stop')
    print ('you reached minimum level')
    print ('ssd should stay the same to last ssd')

#correct go 
elif (key_resp.corr == 1 and sound_yes_no == 0):
    print ('correct go')

#incorrect go 
elif (key_resp.corr == 0 and sound_yes_no == 0):
    print ('incorrect go')
#other conditions
else:
    print ('whats going on?')

this is what it prints on the runner when I dont touch the scree…

Hello from the pygame community. Contribute - pygame wiki
0.2
incorrect stop
ssd should be smaller in .050 compared to last ssd
correct go
incorrect go
incorrect go
incorrect go
0.15000000000000002
incorrect stop
ssd should be smaller in .050 compared to last ssd
correct go
incorrect go
incorrect go
incorrect go
0.10000000000000002
incorrect stop
ssd should be smaller in .050 compared to last ssd
correct go
incorrect go
incorrect go
incorrect go
0.05000000000000002
incorrect stop
ssd should be smaller in .050 compared to last ssd
0.10000000000000002
correct stop
ssd should be larger in .050 compared to last ssd
correct go
incorrect go
incorrect go
incorrect go
0.05000000000000002
incorrect stop
ssd should be smaller in .050 compared to last ssd
4.0150 WARNING We strongly recommend you activate the PTB sound engine in PsychoPy prefs as the preferred audio engine. Its timing is vastly superior. Your prefs are currently set to use [‘sounddevice’, ‘PTB’, ‘pyo’, ‘pygame’] (in that order).

Experiment ended.

[complex__stop_signal_main_version_ 29.07.2021.psyexp (39.8 KB)]
complex_for_experiment_5.8.2021.xlsx (12.7 KB)

Hi There,

I highly suspect the code accompanying this preprint will help here https://psyarxiv.com/fzdp2 (note: I am biased as I am the second author and code maintainer)

Becca

Great.
Thanks Becca!