up Inquisit Language Reference

isCorrectResponse attribute

The isCorrectResponse attribute specifies custom logic used to classify a response as correct or incorrect.

Member of

<trial> <likert> <openended> <sliderTrial>

Syntax

/ isCorrectResponse = { script }

Parameters

Name Type Description
script script An expression that returns boolean true or false. See help with expression syntax for more information.

Remarks

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.

Requires an explicit 'return' statement.

Examples

The following classifies the response as correct based on both the key that is pressed and the response time. Note that 'this' represents 'trial.myTrial' in this context.

<trial myTrial>
/ stimulusTimes=[0=teststim]
/ isCorrectResponse={ return (this.latency < values.timeout && this.response == 32);}
</trial>

The following classifies the response as correct based on the key that was pressed as well as a condition variable. Note that 'this' represents 'trial.myTrial' in this context.

<trial myTrial>
/ stimulusTimes=[0=teststim]
/ isCorrectResponse={ return (values.condition == 3 && this.response == 32);}
</trial>

The following classifies the response as correct based on a predefined expression:

<trial myTrial>
/ stimulusTimes=[0=teststim]
/ isCorrectResponse={ return expressions.correctlogic;}
</trial>

Copyright Millisecond Software, LLC. All rights reserved.