Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix JS code for checking of correct non-response
Fix the JS code written at the end of a routine so
that it checks to see if it was a non-response before
evaluating if the non-response was the correct answer.

This fixes a problem where normal correct responses
are not written to the data file
  • Loading branch information
jonathanoroberts authored and peircej committed Jun 15, 2017
1 parent dcd0efb commit f903210
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions psychopy/app/builder/components/keyboard/__init__.py
Expand Up @@ -490,10 +490,12 @@ def writeRoutineEndCodeJS(self, buff):

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

Expand Down

0 comments on commit f903210

Please sign in to comment.