dropdown.settings.callback

getDropDown(id).settings.callback( command ) (since PennController 1.5) or getDropDown(id).settings.callback( command1, command2 ) (since PennController 1.5) Will execute the command(s) whenever an option is selected from the drop-down list. Example: [js highlight=”7-18″ try=”true”]newText(“The weather is”) .settings.after( newDropDown(“temp”,”…”).settings.add(“cold”,”warm”,”hot”) ) .settings.after( newText(“implicature”, “implies that the weather is …”) ) .print() , getDropDown(“temp”) .settings.callback( getDropDown(“temp”) .test.selected(“warm”).success( getText(“implicature”).settings.text(“implicates that the weather …

standard.settings.cssContainer

getElement(id).settings.cssContainer(“styleName”, “style”) or getElement(id).settings.cssContainer({“style name 1”: “style 1”, “style name 2”: “style 2″}) Applies the CSS style(s) to the container’s element. This will affect both the element itself and any element wrapping it as added via or . This command often more closely accomplishes what you want to achieve than the command. Example: [js highlight=”4″ …

scale.settings.keys

getScale(id).settings.keys( “key1”, “key2”, … ) or getScale(id).settings.keys() Respectively associates the scale’s options with the specified keys for selection. If you pass no argument, will check whether your scale’s options are all single characters and, if so, will use them as keys. If not, will respectively associate the scale’s options with the numeric keys. Example: [js …

key.settings.callback

getKey(id).settings.callback( command ) or getKey(id).settings.callback( command1, command2 ) Will execute the command(s) whenever a key corresponding to the element is pressed. Example: [js highlight=”7-17″ try=”true”]newText(“sentence”, “Hello world”) .print() , newVar(“word”, 0) , newKey(“control”, ” \n\r”) .settings.callback( getText(“sentence”) .settings.color(“red”) , newTimer(1000) .start() .wait() , getText(“sentence”) .settings.color(“black”) )[/js] Prints Hello world onto the page and will highlight …

button.settings.callback

getButton(id).settings.callback( command ) or getButton(id).settings.callback( command1, command2 ) Will execute the command(s) whenever the button is clicked. Example: [js highlight=”5-9″ try=”true”]newVideo(“skate”, “skate.mp4”) .print() , newButton(“(Re)play”) .settings.callback( getVideo(“skate”) .stop() .play() ) .print()[/js] Adds onto the page a video and a button which, whenever clicked, starts or restarts playing the video from the beginning.

dropdown.settings.log

getDropDown(id).settings.log() or getDropDown(id).settings.log(“first”) or getDropDown(id).settings.log(“all”) Will add a line to the results file for the current trial reporting what option was selected. If you pass “first” as the argument, it will report the option selected upon first selection, ignoring further selections. If you pass “all” as the argument, it will add a line for each …

dropdown.settings.remove

getDropDown(id).settings.remove(“option”) Removes a single option from the list. Nothing happens if the option passed as an argument is in fact not in the list. Example: [js highlight=”17,18″ try=”true”]newDropDown(“value” , “Truth value”) .settings.add( “True” , “False” ) .print() , newScale(“logic”, “Binary”,”Three-valued”) .settings.default(“Binary”) .settings.before( newText(“Logic: “) ) .settings.labelsPosition(“right”) .settings.callback( getScale(“logic”) .test.selected(“Three-valued”) .success( getDropDown(“value”) .settings.add(“Other”) ) .failure( getDropDown(“value”) …

dropdown.settings.add

getDropDown(id).settings.add(“option”) or getDropDown(id).settings.add(“option1″,”option2″,…) Adds an option, or several options to the drop-down list. Example: [js highlight=”2″ try=”true”]newDropDown(“language” , “First language”) .settings.add( “English” , “French” , “Tagalog” ) .print() [/js] Creates a drop-down list with default text First language and adds three options to it: English, French and Tagalog, then prints the list onto the page.

video.settings.log

getVideo(id).settings.log() or getVideo(id).settings.log(“play”) or getVideo(id).settings.log(“pause”) or getVideo(id).settings.log(“end”) or getVideo(id).settings.log(“seek”) Tells to add a line in the results file each time an event happens. If you do not specify which event you want to log, all of them will add a line to the results file. “play” adds a line including a timestamp and an offset, …

video.settings.once

getVideo(id).settings.once() Disables the buttons to play/pause the video right after its first playing (the video can still be played using the action play). Example: [js highlight=”5″ try=”true”] newText(“instructions”, “Please watch the video below”) .print() , newVideo(“skate”, “skate.mp4”) .settings.once() .print() .wait() [/js] Adds some instruction text to the screen and a video below the text. After …