getScale(id).settings.callback( sequenceOfCommands ) (since beta 0.4) Executes a sequence of commands whenever a choice is made on the scale. This is particularly useful if, for example, you want to reveal a only when a certain option is chosen. Example: [js highlight=”7-12″ try=”true”] newTextInput( “other” , “” ) .settings.hidden() , newScale(“yarrel”, “Yanny”, “Laurel”, “other”) .settings.labelsPosition( “right” …
Wiki Category Archives:
scale.settings.button
getScale(id).settings.button() Makes the buttons of the scale appear as clickable text buttons that are framed when selected. If you passed a number when creating the scale, the buttons will be labeled with numbers (starting from 0). Example: [js highlight=”2″ try=”true”]newScale(“score”, 6) .settings.button() .settings.before( newText(“score label”, “Score: “) ) .settings.after( newText(“score text”, ” / 5″) ) …
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.settings.log
getKey(id).settings.log() or getKey(id).settings.log(“wait”) (since beta 0.4) or getKey(id).settings.log(“first”) (since beta 0.4) or getKey(id).settings.log(“last”) (since beta 0.4) or getKey(id).settings.log(“all”) A line will be added to the results file indicating which key was pressed when. If you leave the parentheses blank or pass “wait” (those are equivalent) then key presses will only be logged if they validate …
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.settings.log
getHtml(id).settings.log() (since beta 0.2) Will add a line at the end of the trial for each <textarea>, <input type=’text’>, <input type=’checkbox’> and <input type=’radio’> in the document. Example: [js highlight=”2″]newHtml(“feedback”, “Feedback.html”) .settings.log() .print() , newButton(“send”, “Send”) .print() .wait()[/js] Adds the content of the file Feedback.html from the Resources (chunk_includes) folder of the Ibex project to …
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!”) …
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.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 …