tooltip.settings.log

getAudio(id).settings.log() (since beta 0.3) Will add a line in the results file each time the tooltip is validated. Example: [js highlight=”7″]newAudio(“sentence”, “test_sentence.ogg”) .settings.log() .wait() .print() , newTooltip(“instructions”, “Use this interface to replay the audio as many times as you want”) .settings.log() .print( getAudio(“sentence”) ) .wait()[/js] Starts playing the audio file testsentence.ogg_ and, when it has …

tooltip.settings.label

getTooltip(id).settings.label(“text”) (since beta 0.3) Resets the text of the validation button. Example: [js highlight=”15″ try=”true”]newAudio(“sentence”, “test.mp3”) .settings.disable() .print() .play() , newTooltip(“instruction”, “After the audio is done playing, you can replay it as many times as you want”, “Please wait”) .settings.disable() .print( getAudio(“sentence”) ) , getAudio(“sentence”) .wait() .settings.enable() , getTooltip(“instruction”) .settings.label(“OK”) .settings.enable() .wait() [/js] Adds a …

tooltip.settings.key

getTooltip(id).key(“keys”) or getTooltip(id).key(“keys”, “no click”) or getTooltip(id).key(keycode) or getTooltip(id).key(keycode, “no click”) (since beta 0.3) Makes it possible to validate the tooltip by pressing a key. You can either pass a string of keys, or pass the keycode of a specific key (e.g. 13 for enter/return). If you pass a non-null second parameter (e.g. “no click”) …

tooltip.settings.frame

getTooltip(id).settings.frame() or getTooltip(id).settings.frame(“frame-style frame-width frame-color”) (since beta 0.3) Will add a frame surrounding the element to which the tooltip is attached when it is printed. You can optionally define the aesthetics of the frame by passing a string following the CSS format for borders. [js highlight=”5″ try=”true”]newImage(“myImage”, “square.png”) .print() , newTooltip(“myTooltip”, “This is a square”) …

tooltip.wait

getTooltip(id).wait() or getTooltip(id).wait(“first”) or getTooltip(id).wait(test) (since beta 0.3) Waits until the tooltip is validated and disappears before evaluating and executing the next commands. If you call wait(“first”), then if the tooltip has already been validated at least once by the time this command is evaluated, the next commands are evaluated and executed right away. If …

tooltip.print

getTooltip(id).print() or getTooltip(id).print( getElement(id) ) (since beta 0.3) or getTooltip(id).print( x , y ) (since PennController 1.6) Adds the tooltip to the page, or attaches it to the referenced element (if any). Since PennController 1.6, you can pass x and y coordinates to print the tooltip at a specific point on the screen/document. [js highlight=”5″ …

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 …

timer.start

getTimer(id).start() Starts the timer. Example: [js highlight=”5″ try=”true”]newText(“pleasewait”, “Please wait 1s.”) .print() , newTimer(“wait”, 1000) .start() .wait() , getText(“pleasewait”) .remove() [/js] The code above adds the text Please wait 1s to the screen, starts a 1000ms timer and wait until it is done before removing the text.