getHtml(id).warn() (since beta 0.3) Displays an error message for each of the obligatory fields from the HTML document that have not been filled yet. See the IBEX documentation about the Form controller for a discussion of how fields are set as obligatory. Example: [js highlight=”8″ try=”true”]newHtml(“demographics”, “example_intro.html”) .print() , newButton(“continue”, “Continue to the next page”) …
Wiki Category Archives:
function.test.is
getFunction(id).test.is() or getFunction(id).test.is( value ) Executes the function and tests the value it returns. If you specify no value, it yields success if the return value is 0, null, undefined or false. NOTE: remember that the expression you pass as the test value is executed at the very beginning of the experiment. So calling getFunction(“myFunction”).test.is( …
function.call
getFunction(id).call() Executes the function. Example: [js try=”true” highlight=”12-13″] newFunction(“setKeyTime”, function(){ this.keyTime = Date.now(); }), newFunction(“keyTimerDelay”, function(){ return Date.now() – this.keyTime > 10; }), newButton(“Start”, “Start”) .print() .wait(), newText(“instrutions”, “Quick, you have one second to press the T key!”) .print(), newTimer(“quick”, 1010) .start(), newKey(“t”, “T”) .wait(), getFunction(“setKeyTime”) .call(), getTimer(“quick”) .wait(“first”), getFunction(“keyTimerDelay”) .test.is(true) .success( newText(“success”, “Good job!”) …
canvas.settings.add
getCanvas(id).settings.add( x, y, element ) or getCanvas(id).settings.add( “left at x”, “top at y”, element ) (since PennController 1.1) or getCanvas(id).settings.add( “center at x”, “middle at y”, element ) (since PennController 1.1) or getCanvas(id).settings.add( “right at x”, “bottom at y”, element ) (since PennController 1.1) Places element onto the canvas at the coordinates (x, y). Note …
button.test.clicked
getButton(id).test.clicked() (since beta 0.3) Tests whether the button was ever clicked before.
button.settings.log
getButton(id).settings.log() Adds a line to the results file each time the button is clicked. Example: [js highlight=”2″]newButton(“word”, “It’s a word!”) .settings.log() .settings.once() .print() , newAudio(“sound”, “sound.wav”) .play() .wait()[/js] Adds a button to the screen, plays the audio file sound.wav and proceeds when the audio is done playing. The button can only be clicked once (see …
button.settings.once
getButton(id).settings.once() Disables the button right after it is clicked for the first time. Example: [js highlight=”3″ try=”true”]newButton(“test”, “It’s a test!”) .settings.log() .settings.once() .print() , newAudio(“sound”, “test.mp3”) .play() .wait()[/js] Adds a button to the screen, plays the audio file test.mp3 and proceeds when the audio is done playing. The button can only be clicked once, and …
button.wait
getButton(id).wait() or getButton(id).wait(“first”) or getButton(id).wait( test ) Waits until the button it clicked before evaluating and executing the next commands. If you call wait(“first”), then if the button was already clicked at least once by the time this command is evaluated, the next commands are evaluated and executed right away. If it was never clicked …
audio.test.playing
getAudio(id).test.playing() (since beta 0.3) Tests whether the audio stream is playing at the moment when the test command gets evaluated.
audio.test.hasPlayed
getAudio(id).test.hasPlayed() (since beta 0.3) Tests whether the audio stream has played at least once before in the trial.