up Inquisit Language Reference

expressions element

The expressions element contains custom expressions that can be used throughout the script.

Attributes

<expressions>
This element has no attributes
</expressions>

Properties

expressions.name
expressions.typeName

Functions

None.

Remarks

SomeTimes a script may use long and complicated expressions, or reuse a given expression in a number of places. The expression element allows you to define such expressions and assign them a name. You can then conveniently refer to the expression by its name wherever it is used in the script. Expressions are dynamically evaluated each time they are used so that they always reflect up to date values. Expressions may include other expressions defined, although you should avoid circular references.

Expressions require a 'return' statement.

Examples

The following defines an expression that reflects the total score across three different conditions.

<expressions>
/ totalscore = return (values.congruentscore + values.incongruentscore + values.neutralscore)
</expressions>

The following defines an expression that returns whether the current trial is even or odd.

<expressions>
/ isoddnumberedtrial = return (mod(script.trialCount) > 0) </expressions>

Copyright Millisecond Software, LLC. All rights reserved.