Post by maya on Aug 15, 2021 16:24:19 GMT
Hello,
Below is a part of my code with which I have run into a problem:
keys Enter f j
...
readkey 2 50000
set $b RT
if STATUS == CORRECT
set &correct_count increase
set $a 1
draw off
show bitmap feedbackcorrect1
sound feedbacksoundcorrect1
draw on
delay 8400
clear -1
draw off
show bitmap feedbackcorrect2
sound feedbacksoundcorrect2
draw on
delay 2500
clear -1
show bitmap feedbackcorrect3
readkey 1 100000
fi
if STATUS != CORRECT
set $a 2
draw off
show bitmap feedbackincorrect1
sound feedbacksoundincorrect1
draw on
delay 8800
clear -1
draw off
show bitmap feedbackincorrect2
sound feedbacksoundincorrect2
draw on
delay 2500
clear -1
show bitmap feedbackincorrect3
readkey 1 100000
fi
After 'readkey 2 50000', I would like either correct or incorrect feedback to be shown depending on whether the keypress was right. The problem is at the end of 'if STATUS == CORRECT', there is another keypress 'readkey 1 100000', which is only an Enter keypress to move onto the next slide. If the other two keys are pressed accidentally, the 'if STATUS != CORRECT' scenario will play, but I only want that scenario to play if the first keypress (readkey 2 50000) is wrong. Is there any way to specify for 'if STATUS != CORRECT' that the readkey status is referring to the first readkey command and not the one under the if section?
NB: I put the 'enter' keypress under task instead of block because this part of the code is contained within a section that requires looping if the subjects do not get enough correct responses. Not sure if this is the best way to do this.
Below is a part of my code with which I have run into a problem:
keys Enter f j
...
readkey 2 50000
set $b RT
if STATUS == CORRECT
set &correct_count increase
set $a 1
draw off
show bitmap feedbackcorrect1
sound feedbacksoundcorrect1
draw on
delay 8400
clear -1
draw off
show bitmap feedbackcorrect2
sound feedbacksoundcorrect2
draw on
delay 2500
clear -1
show bitmap feedbackcorrect3
readkey 1 100000
fi
if STATUS != CORRECT
set $a 2
draw off
show bitmap feedbackincorrect1
sound feedbacksoundincorrect1
draw on
delay 8800
clear -1
draw off
show bitmap feedbackincorrect2
sound feedbacksoundincorrect2
draw on
delay 2500
clear -1
show bitmap feedbackincorrect3
readkey 1 100000
fi
After 'readkey 2 50000', I would like either correct or incorrect feedback to be shown depending on whether the keypress was right. The problem is at the end of 'if STATUS == CORRECT', there is another keypress 'readkey 1 100000', which is only an Enter keypress to move onto the next slide. If the other two keys are pressed accidentally, the 'if STATUS != CORRECT' scenario will play, but I only want that scenario to play if the first keypress (readkey 2 50000) is wrong. Is there any way to specify for 'if STATUS != CORRECT' that the readkey status is referring to the first readkey command and not the one under the if section?
NB: I put the 'enter' keypress under task instead of block because this part of the code is contained within a section that requires looping if the subjects do not get enough correct responses. Not sure if this is the best way to do this.