Skip to content

Commit

Permalink
BF: JS outputs from Builder not detecting non-response correctly
Browse files Browse the repository at this point in the history
Go/no-go tasks weren't working as a result
  • Loading branch information
peircej committed Jan 31, 2019
1 parent a873397 commit 0c3cea2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions psychopy/experiment/components/keyboard/__init__.py
Expand Up @@ -490,16 +490,16 @@ def writeRoutineEndCodeJS(self, buff):

# write the actual code
code = ("\n// check responses\n"
"if (['', [], undefined].indexOf(%(name)s.keys) >= 0) {"
"if (%(name)s.keys === undefined || %(name)s.keys.length === 0) {"
" // No response was made\n"
" %(name)s.keys = undefined;\n"
"}\n\n")
buff.writeIndentedLines(code % self.params)

if self.params['storeCorrect'].val: # check for correct NON-repsonse
code = ("// was no response the correct answer?!\n"
"if (%(name)s.keys == undefined) {\n"
" if (psychoJS.str(%(correctAns)s).toLowerCase() == 'none') {\n"
"if (%(name)s.keys === undefined) {\n"
" if (['None','none',undefined].includes(%(correctAns)s)) {\n"
" %(name)s.corr = 1 // correct non-response\n"
" } else {\n"
" %(name)s.corr = 0 // failed to respond (incorrectly)\n"
Expand Down

0 comments on commit 0c3cea2

Please sign in to comment.