voicerecorder.wait

The VoiceRecorder element is deprecated since PennController 1.8. See instead. getVoiceRecorder(id).wait() or getVoiceRecorder(id).wait(“first”) or getVoiceRecorder(id).wait(“playback”) (since PennController 1.1) Waits for the current (or next) recording to be over. If you pass “first” and a recording had already been done by the time this command get evaluated and executed, the commands that come next are immediately …

voicerecorder.stop

The VoiceRecorder element is deprecated since PennController 1.8. See instead. getVoiceRecorder(id).stop() Stop recording audio / playing last recording. Example: [js highlight=”12,20″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newVoiceRecorder(“recorder”) .record() , newTimer(“recording”, 3000) .start() .wait() , getVoiceRecorder(“recorder”) .stop() .play() , newTimer(“preview”, 1000) .start() .wait() , getVoiceRecorder(“recorder”) .stop() );[/js] Will start recording audio and stop recording after 2s, then play back …

voicerecorder.record

The VoiceRecorder element is deprecated since PennController 1.8. See instead. getVoiceRecorder(id).record() Starts recording audio. Example: [js highlight=”5″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newVoiceRecorder(“recorder”) .record() , newTimer(“recording”, 2000) .start() .wait() , getVoiceRecorder(“recorder”) .stop() .play() .wait(“playback”) );[/js] Will record audio for 2s and then play it back.

voicerecorder.play

The VoiceRecorder element is deprecated since PennController 1.8. See instead. getVoiceRecorder(id).play() Starts playing the last recording (if any). Example: [js highlight=”13″ try=”data”]InitiateRecorder(“https://myserver/upload.php”); newTrial( newVoiceRecorder(“recorder”) .record() , newTimer(“recording”, 2000) .start() .wait() , getVoiceRecorder(“recorder”) .stop() .play() .wait(“playback”) ); [/js] Will record audio for 2s and then play it back.

var.set

getVar(id).set( value ) (since beta 0.3) or getVar(id).set( function ) Sets the Var element to the specified value. You can pass a function as value, which takes the current value of the Var element as an argument and should return the new value to which it will be updated. Example: [js highlight=”14″ try=”true”]defaultText .print() , …

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.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.

textinput.wait

getTextInput(id).wait() or getTextInput(id).wait(“first”) or getTextInput(id).wait( test ) Waits until the enter/return key is pressed while entering text in the input box. Note that if you have a multiple-line input box, this can also mean insertion of a new line. If you call wait(“first”), then if the enter/return key was already pressed while editing when this …