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 …

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″ …

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.test.selected

getDropDown(id).test.selected(option) or getDropDown(id).test.selected() Tests whether an option is selected. If you pass no option as an argument, then the test will succeed as long as any option is selected. If you pass a number, and provided there is no option whose text content corresponds to this exact number, it will test the index of the …

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.

dropdown.wait

getDropDown(id).wait() or getDropDown(id).wait(“first”) or getDropDown(id).wait(test) Waits until an option is selected from the drop-down list before proceeding. If you call wait(“first”), then if an option has already been selected by the time this command is evaluated, the next commands are evaluated and executed right away. If no option has been selected so far, the next …

dropdown.select

getDropDown(id).select( “option” ) Selects an option in the drop-down list. Nothing happens if the option passed as an argument does not exist. Example: [js highlight=”3″ try=”true”]newDropDown(“warmth”, “”) .settings.add(“hot”, “lukewarm”, “cold”) .select( “lukewarm” ) , newText(“Spring in Colorado is  “) .settings.after( getDropDown(“warmth”) ) .print()[/js] Creates a drop-down list containing the options hot, lukewarm and cold, selects …

dropdown.shuffle

getDropDown(id).shuffle() or getDropDown(id).shuffle( “keep selected” ) Shuffles the options that have been added to the DropDown so far. If you call shuffle before settings.add then it will have no effect. Passing an argument means that you want any option currently selected to remain selected after the shuffle (“keep selected” is simply given as an example—you …