The expressions element contains custom expressions that can be used throughout the script.
<expressions>
/ expressionname1
/ expressionname2
/ expressionname3
</expressions>
expressions.expressionname1
expressions.expressionname2
expressions.expressionname3
expressions.name
expressions.typename
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.
The following defines an expression that reflects the total score across three different conditions.
<expressions>
/ totalscore = values.congruentscore + values.incongruentscore + values.neutralscore
</expressions>
The following defines an expression the returns whether the current trial is even or odd.
<expressions>
/ isoddnumberedtrial = (mod(script.trialcount) > 0) </expressions>