The iscorrectresponse attribute specifies custom logic used to classify a response as correct or incorrect.
<likert> <openended> <slidertrial> <trial>
expression | An expression that returns boolean true or false. See help with expression syntax for more information. |
After a response is made on a given trial, this parameter specifies an expression to be evaluated that determines whether the response should be scored as correct or incorrect. If the expression returns a logical value of true (any non-null or nonzero value), the response is considered correct. If the expression returns boolean false (zero or null), the response is considered incorrect.
This command can be used instead of or in conjunction with correctresponse to define dynamic or conditional rules for judging response accuracy.
The following classifies the response as correct based on both the key that is pressed and the response time:
<trial mytrial>
/ stimulusframes=[1=teststim]
/ iscorrectresponse=[trial.mytrial.beginresponsetime < values.timeout && trial.mytrial.response == 32]
</trial>
The following classifies the response as correct based on a randomly assigned variable:
<trial mytrial>
/ stimulusframes=[1=teststim]
/ iscorrectresponse=[values.condition == 3 && trial.mytrial.response == 32]
</trial>
The following classifies the response as correct based on a predefined expression:
<trial mytrial>
/ stimulusframes=[1=teststim]
/ iscorrectresponse=[expressions.correctlogic]
</trial>