The expressions element contains custom expressions that can be used throughout the script.
None.
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.
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>