end
syntax
end()
description
Ends a trial immediately.
example
PennController.ResetPrefix(null);
newTrial(
newText("instructions", "Press F to end the trial immediately, or press J to continue.")
.print()
,
newKey("fj", "FJ")
.wait()
,
getKey("fj")
.test.pressed("F")
.success(end())
.failure(
newText("continue", "The trial has continued! Press the spacebar to finish.")
.print()
,
newKey(" ")
.wait()
)
)
- Prints the
"instructions"
Text
element to the screen. - Creates the
"fj"
Key
element and waits for theF
orJ
key to be pressed.- If
F
was pressed, end the trial immediately. - Otherwise, print the
"continue"
Text
element and wait for theSpacebar
key to be pressed.
- If