The stop command specifies the conditions in which a trial should end.
<trial> <likert> <openended> <sliderTrial> <surveyPage>
Name | Type | Description |
---|---|---|
script | script | Specifies the expression to evaluate to determine whether the trial should stop. |
When the stop command is defined for a trial, the trial continues to run and poll for responses until the logical expression is the stop condition is true. The stop command is useful for tracking multiple responses within a trial or tracking continuous response data. For example, a test that measures Visual Analog Scale responses as participants watch a video would check that the video is no longer playing as a stop condition. Every valid response made before the trial stops is registered and triggers any associated response, error, or correct messages.
The stop command requires an explicit 'return' statement.
The following trial plays a video until the end, registering left and right mouse button clicks along the way:
<trial vsa>
/ stimulusTimes=[0=testvideos]
/ stop={
return (video.testvideos.isPlaying == false;);
}
/ validResponse=(lButtonDown, rButtonDown)
</trial>