File tree 1 file changed +3
-3
lines changed
psychopy/experiment/components/keyboard
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -490,16 +490,16 @@ def writeRoutineEndCodeJS(self, buff):
490
490
491
491
# write the actual code
492
492
code = ("\n // check responses\n "
493
- "if (['', [], undefined].indexOf( %(name)s.keys) > = 0) {"
493
+ "if (%(name)s.keys === undefined || %(name)s.keys.length == = 0) {"
494
494
" // No response was made\n "
495
495
" %(name)s.keys = undefined;\n "
496
496
"}\n \n " )
497
497
buff .writeIndentedLines (code % self .params )
498
498
499
499
if self .params ['storeCorrect' ].val : # check for correct NON-repsonse
500
500
code = ("// was no response the correct answer?!\n "
501
- "if (%(name)s.keys == undefined) {\n "
502
- " if (psychoJS.str (%(correctAns)s).toLowerCase() == 'none' ) {\n "
501
+ "if (%(name)s.keys === undefined) {\n "
502
+ " if (['None','none',undefined].includes (%(correctAns)s)) {\n "
503
503
" %(name)s.corr = 1 // correct non-response\n "
504
504
" } else {\n "
505
505
" %(name)s.corr = 0 // failed to respond (incorrectly)\n "
You can’t perform that action at this time.
0 commit comments