The onPrepare attribute specifies expressions to evaluated before a given stimulus is prepared for presentation.
Name | Type | Description |
---|---|---|
script | script | One or more expressions, delimited by semi-colons. See help with expression syntax for more information. |
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.
The following text increments a value called "hitcount" by 1 before the value on the screen:
<text myText>
/ items=("<% values.hitcount %>")
/ onPrepare={
values.hitcount++;
}
</text>