up Inquisit Language Reference

onprepare attribute

The onPrepare attribute specifies expressions to evaluated before a given stimulus is prepared for presentation.

Member of

<button> <clock> <html> <picture> <port> <shape> <sound> <text> <video> <xid>

Syntax

/ onprepare = { script }

or

/ onprepare = [ script ]

Parameters

Name Type Description
script script One or more expressions, delimited by semi-colons. See help with expression syntax for more information.

Remarks

This parameter executes a set of expressions just before a stimulus is readied for presentation. The expressions can read and conditionally update the various properties in the script. This is useful for dynamically configuring properties of a stimulus (e.g., font, size, screen position, item content) whenever it is presented.

Examples

The following text increments a value called "hitcount" by 1 before the value on the screen:

<text myText>
/ items=("<% values.hitcount %>")
/ onPrepare=[ values.hitcount = values.hitcount + 1]
</text>

Copyright Millisecond Software, LLC. All rights reserved.