selector.wait

getSelector(id).wait() or getSelector(id).wait(“first”) or getSelector(id).wait(test) Waits until one of the elements of the selector is selected before evaluating and executing the next commands. If you call wait(“first”), then if an element has already been selected before this command is evaluated, the next commands are evaluated and executed right away. If no element was selected before, …

selector.unselect

getSelector(id).unselect() (since beta 0.3) Unselects any element currently selected.

selector.shuffle

getSelector(id).shuffle() (since beta 0.3) or getSelector(id).shuffle( element1 , element2 , … ) Shuffles the elements that have been added to the selector so far, so their positions on the page are randomly switched (NB: make sure the elements are already printed when you call shuffle). You can specify a subset of elements to be shifted, …

selector.select

getSelector(id).select(element) Selects the specified element. Example: [js highlight=”9″ try=”true”]newImage(“square”, “square.png”) , newImage(“triangle”, “triangle.png”) .settings.before( getImage(“square”) ) .print() , newSelector(“shapes”) .settings.add( getImage(“square”) , getImage(“triangle”) ) .select( getImage(“square”) ) .wait()[/js] Adds two images side by side, selects the image square by default, and waits for a click on either one of them.

scale.wait

getScale(id).wait() or getScale(id).wait(“first”) or getScale(id).wait(test) Waits until one of the buttons is clicked before evaluating and executing the next commands. If you call wait(“first”), then if a button is already selected when this command is evaluated, the next commands are evaluated and executed right away. If no button in the scale was clicked before, the …

key.wait

getKey(id).wait() or getKey(id).wait(“first”) or getKey(id).wait(test) Waits until a key is pressed. If you call wait(“first”), then if a valid key has been pressed since the creation of the key element, the next commands are evaluated and executed right away. If no valid key was pressed in the meantime, the next commands are only evaluated and …

html.warn

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”) …

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!”) …

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

getAudio(id).wait() or getAudio(id).wait(“first”) or getAudio(id).wait(test) Waits until the audio resource is done playing before evaluating and executing the next commands. If you call wait(“first”), then if the audio has already been played at least once by the time this command is evaluated, the next commands are evaluated and executed right away. If it was never …