Post by hmcl on Nov 28, 2020 15:22:30 GMT
Hi,
I'm completely new at Psytoolkit programming. I've downloaded the Go-no Go pre programmed code, and changed it to use my own stimuli and instructions.
I would like to have a training session in which the participant has to repeat the session if the total percentage of incorrect responses (in the go trials : misses, in the nogo trials : false alarms) is superior to 20%. In the training session, I have 20 go trials and 5 no go trials, so I've calculated the percentage of incorrect responses depending on the type of trial and converted it to sum (if total misses > 4 , and if total false alarms > 2, then restart training block). That's how I've coded it but I could also do this in percentages I gather. I cannot figure out how to code this properly. I've put the code in the "block training" section at the bottom but it's not working. Here's the code, if anyone could help I would be really greatful ! :
bitmaps
...
task go
keys enter
set $errorstatus 0
show bitmap gosignal
readkey 1 800 # wait 800 ms for button to be pressed
clear 1
if STATUS == TIMEOUT
set $errorstatus 1
show bitmap errorGo
delay 500
clear 2
fi
delay 500
save TASKNAME RT $errorstatus
task nogo
keys enter
set $errorstatus 0
show bitmap nogosignal
readkey 1 800
clear 1
if STATUS != TIMEOUT
set $errorstatus 1
show bitmap errorGo
delay 500
clear 2
fi
delay 500 # intertrial interval
save TASKNAME RT $errorstatus
# -------------------------------------
message GoInstruction
block training
tasklist
go 20
nogo 5
end
feedback
set &total_result_training sum STATUS go == 1
if &total_result_training > 4
start block training
fi
set &total_mistakes sum STATUS nogo == 1
if &total_mistakes > 2
start block training
fi
end
block task
message EndTraining
tasklist
go 40
nogo 10
end
block test
message Pause
tasklist
go 40
nogo 10
end
...
task go
keys enter
set $errorstatus 0
show bitmap gosignal
readkey 1 800 # wait 800 ms for button to be pressed
clear 1
if STATUS == TIMEOUT
set $errorstatus 1
show bitmap errorGo
delay 500
clear 2
fi
delay 500
save TASKNAME RT $errorstatus
task nogo
keys enter
set $errorstatus 0
show bitmap nogosignal
readkey 1 800
clear 1
if STATUS != TIMEOUT
set $errorstatus 1
show bitmap errorGo
delay 500
clear 2
fi
delay 500 # intertrial interval
save TASKNAME RT $errorstatus
# -------------------------------------
message GoInstruction
block training
tasklist
go 20
nogo 5
end
feedback
set &total_result_training sum STATUS go == 1
if &total_result_training > 4
start block training
fi
set &total_mistakes sum STATUS nogo == 1
if &total_mistakes > 2
start block training
fi
end
block task
message EndTraining
tasklist
go 40
nogo 10
end
block test
message Pause
tasklist
go 40
nogo 10
end