This sample demonstrates the methods necessary to vary the duration of an object based on the subject's responses to previous trials.
The nDuration variable is declared globally on the User tab of the Script window. This makes the variable available over the course of the entire experiment, and allows information from previous trials to be used during the current trial.
At the end of each trial, the subject's accuracy is assessed, and the nDuration variable is then adjusted to reflect the subject's performance. At the start of the trial, the value of nDuration is assigned to an attribute that is referenced in the 'Stimulus' object's Duration property.