dropdown.settings.once

getDropDown(id).settings.once() (since PennController 1.5) Will disable the DropDown element after selection occurs. Example: [js highlight=”2″ try=”true”]newText(“I saw Erika talk to Nate.”) .settings.after( newDropDown(“”).settings.add(“He”,”She”).settings.once() ) .settings.after( newText(“seemed anxious.”) ) .print()[/js] Prints I saw Erika talk to Nate. ___ seemed nervous onto the page, where ___ is a drop-down list containing the options He and She. The …

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 …

PennController.DebugOff

PennController.DebugOff() (since PennController 1.4) Tells your experiment to not run in Debug mode. This will close the popin window at the bottom-right corner of your experiment, no longer providing you with debugging tools and helpful feedback. You should only use this command when you are ready to collect data. Check the tutorial for a rapid …

text.unfold

getText(id).unfold( delay ) (since PennController 1.3) Unfolds the text in delay milliseconds. Example: [js highlight=”2″ try=”true”]newText(“Hello world”) .unfold( 3000 ) , newTimer(3000) .start() .wait()[/js] Starts unfolding the text “Hello world” in 3s (which is very slow for only two words) and immediately starts a 3s timer and waits until it ends.

button.click

getButton(id).click() (since PennController 1.2) Simulates a click on the button. Example: [js highlight=”3,4″ try=”true”]newKey(” “) .settings.callback( getButton(“continue”) .click() ) , newButton(“continue”, “Continue”) .print() .wait()[/js] Creates a Key element associated with the spacebar which, whenever pressed, will simulate a click on the continue button added below it, then will wait until the button is clicked (or …

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

getScale(id).select(option) or getScale(id).select(index) or getScale(id).select(option, “log”) Selects the specified option on the scale. If you pass a second argument (e.g. “log”) then the selection will be treated as if it were a manual selection, and will be recorded in the results file if you called log. Example: [js highlight=”24″ try=”true”]newText(“What programming language is PennController based …

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 …

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 …