getScale(id).settings.label(index,label) Sets the content of the index-th label (with index starting at 0). This will mostly be useful if you want to use something like an Image element as a label, which cannot be passed as a direct parameter when creating the new Scale. [js highlight=”2,3″ try=”true”] newScale(“score”, “Bad”, “So-so”, “Good”) .settings.label( 0 , newImage(“no.png”) …
Wiki Category Archives:
scale.unselect
getScale(id).unselect() (since PennController 1.6) Will unselect the option currently selected. If the scale is a slider, it will set it back to the central value. Example: [js highlight=”5″ try=”true”]newScale(“score”, 10) .print() , newButton(“Unselect”) .settings.callback( getScale(“score”).unselect() ) .print()[/js] Prints a 10-point radio button scale and a button reading Unselect which, when clicked, unselects the currently selected …
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 …
standard.refresh
getElement(id).refresh() (since PennController 1.1) Calls the command again on the element, while leaving it where it was printed last. This command is primarily useful if some aesthetic command does not take effect unless print is called afterward, but you do not want to call print because calling it when you need the aesthetic command to …
standard.setVar
getElement(id).setVar( varName ) (since beta 0.3) Stores the current value of the element in the Var element named varName (if it exists). What the current value corresponds to is specific to each element type: For Audio elements, it corresponds to the timestamp of the end of the last playback so far (0 if never played …
standard.remove
getElement(id).remove() Removes the element from the screen. This has no effect for non-visual elements such as the purely interactive . Note that this leaves no space where the element previously was on the page (this is really removing the element, not just hiding it). Example [js highlight=”4″ try=”true”] newButton(“clickme”, “Click me”) .print() .wait() .remove() [/js] …
standard.test.printed
getElement(id).test.printed() (since beta 0.3) Tests whether the element was printed onto the page (and has not been removed since then). Example: [js highlight=”17-27″ try=”true”] newText(“instructions”, “Click on Top/Bottom to NOT print its word”) .print() , newButton(“top”, “Top”) .settings.callback( getButton(“top”).remove() ) .print() , newButton(“bottom”, “Bottom”) .settings.callback( getButton(“bottom”).remove() ) .print() , newButton(“print”, “Print the buttons’ words”) .print() …
standard.settings.visible
getElement(id).settings.visible() (since beta 0.3) Makes the element visible (again). This is useful if you previously hid the element with .settings.hidden. Example: [js highlight=”13″ try=”true”]newText(“instruction”, “Guess what fruit is in the image below”) .print() , newImage(“fruit”, “pear.png”) .settings.hidden() .print() , newButton(“reveal”, “Reveal fruit”) .print() .wait() , getImage(“fruit”) .settings.visible() [/js] Adds some text to the page, a …