up Inquisit Language Reference

isvalidresponse attribute

The isvalidresponse attribute specifies custom logic used to classify a response as valid or invalid.

Member of

<likert> <openended> <slidertrial> <trial>

Syntax

/ isvalidresponse = [expression; expression; expression; ...]

Parameters

expression 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 valid or invalid. If the expression returns a logical value of true (any non-null or nonzero value), the response is considered valid. If the expression returns boolean false (zero or null), the response is considered invalid.

This command can be used instead of or in conjunction with validresponse to define dynamic or conditional rules for judging response accuracy.

Examples

The following classifies the response as valid if the latency is greater than a minimum response time, and the scancode of the key press is 1 or 2:

<trial mytrial>
/ stimulusframes=[1=teststim]
/ isvalidresponse=[trial.mytrial.latency > values.mintime && (trial.mytrial.response == 2 || trial.mytrial.response == 3)]
</trial>

The following classifies the response as valid if it has exactly 5 characters:

<openended id>
/ stimulusframes=[1=enterid]
/ isvalidresponse=[length(openended.id.response) == 5]
</trial>

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

<trial mytrial>
/ stimulusframes=[1=teststim]
/ isvalidresponse=[expressions.validationlogic]
</trial>

Send comments on this topic:
Copyright Millisecond Software, LLC. All rights reserved.