timer.stop

getTimer(id).stop() (since version 1.1) Stops the timer early. Nothing happens if the timer has already elapsed. When timers are stopped early, the script proceeds in the same way as if they had elapsed on their own: any command associated to the timer is executed and any command on the timer is resolved. [js highlight=”8″ try=”true”] …

standard.setVar

getElement(id).setVar( varName ) (since beta 0.3) Stores the current value of the element in the Var element named varName (if it exists). What the current value corresponds to is specific to each element type: For Audio elements, it corresponds to the timestamp of the end of the last playback so far (0 if never played …

standard.settings.log

getElement(id).settings.log() Will add lines to the results file reporting element-specific events. See each Element page to see what gets recorded, and which parameter you can pass to log. For , and the results lines will report the timestamp corresponding to when print was called (if it was called). Example [js highlight=”6″] newButton(“go”, “Go!”) .print() .wait() …

standard.settings.enable

getElement(id).settings.enable() Enables any interactive feature of the element that was previously disabled. Example: [js highlight=”8″ try=”true”] newAudio(“sentence”, “test.mp3”) .settings.once() .print() , newKey(“secret key”, “R”) .wait() , getAudio(“sentence”) .settings.enable() [/js] Prints buttons to play/pause the audio file test_sentence.ogg, and disables those buttons when the file has played through (see ).

standard.settings.disable

getElement(id).settings.disable() Disables any interactive feature of the element. Note: this does not prevent an element that is part of a from being selected. Example: [js highlight=”6″ try=”true”] newAudio(“sentence”, “test.mp3”) .print() .wait() , getAudio(“sentence”) .settings.disable() [/js] Prints buttons to play/pause the audio file test_sentence.ogg, and disables those buttons when the file has played through.

timer.test.running

getTimer(id).test.running() (since beta 0.3) Tests whether the timer is currently running. Example: [js highlight=”22-24″ try=”true”] newTooltip(“not running”, “The timer is not running”) , newText(“on”, “[on]”) .settings.before( newText(“off”, “[off]”) ) .print() , newSelector(“switch”) .settings.add( getText(“on”) , getText(“off”) ) , newTimer(“quick”, 500) .settings.callback( getSelector(“switch”).select(getText(“off”)) ) , getSelector(“switch”) .settings.callback( getSelector(“switch”).test.selected( getText(“on”) ) .success( getTimer(“quick”).start() ) ) , newButton(“target”, …

timer.test.ended

getTimer(id).test.ended() (since beta 0.3) Tests whether the timer has ended. Example: [js highlight=”12″ try=”true”] newText(“start”, “Ready… go!”) .print() , newTimer(“hurry”, 1000) .start() , newButton(“click”, “Click me!”) .print() .wait() , getTimer(“hurry”) .test.ended() .success( newText(“slow”, “Too slow…”).print() ) .failure( newText(“fast”, “Good job!”).print() ) [/js] Adds a line of text saying Ready… go! to the screen, starts a …

timer.settings.log

getTimer(id).settings.log() Will add a line to the results file each time the timer starts and each time it ends. Example: [js try=”true” highlight=”5″] newText(“pleasewait”, “Please wait 1s.”) .print() , newTimer(“wait”, 1000) .settings.log() .start() .wait() , newButton(“continue”, “Now click here to continue.”) .print() .wait() [/js] Adds the text Please wait 1s to the screen, starts a …

timer.settings.callback

getTimer(id).settings.callback( element ) or getTimer(id).settings.callback( function ) Warning: until PennController beta 0.2, this command has a bug that freezes the script Will execute the function or element command when the timer has finished running for the first time. Example: [js try=”true” highlight=”8″] newText(“start”, “Ready… go!”) .print() , newButton(“click”, “Click me!”) .print() , newTimer(“hurry”, 1000) .settings.callback( …

timer.wait

getTimer(id).wait() or getTimer(id).wait(“first”) or getTimer(id).wait( test ) Waits until the timer has finished running before evaluating and executing the next commands. If you call wait(“first”), then if the timer has already completed a full run before this command is evaluated, the next commands are evaluated and executed right away. If the timer was never completed …