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.settings.log

getElement(id).settings.log() Will add lines to the results file reporting element-specific events. See each Element page to see what gets recorded, and which parameter you can pass to log. For , and the results lines will report the timestamp corresponding to when print was called (if it was called). Example [js highlight=”6″] newButton(“go”, “Go!”) .print() .wait() …

var.test.is

getVar(id).test.is( value ) (since beta 0.3) or getVar(id).test.is( function ) Tests the value of the Var element. You can pass a function which takes the element’s value as its argument and returns true or false. Example: [js highlight=”20,21″ try=”true”]newVar(“trialsLeft”, 3) , newText(“remain”, ” Number of remaining attempts: “) .settings.after( newText(“trial”, “3”) ) , newTextInput(“guess”, “Guess …

var.settings.log

getVar(id).settings.log() (since beta 0.4) or getVar(id).settings.log(“final”) or getVar(id).settings.log(“set”) Adds a line to the results file indicating the value of the Var element. Blank of “final” are equivalent and will add a line reporting the value of the Var element at the end of the trial. Passing “set” will add a line for each .set command …

var.settings.local

getVar(id).settings.local() (since beta 0.3) Makes the Var element accessible only from the script of the current PennController instance (default setting). If a Var element with the same named was made global before (using .settings.global()—see above) then the Var element reverts to being local (while keeping its current value), meaning that any further Var element with …

var.settings.global

getVar(id).settings.global() (since beta 0.3) Makes the Var element accessible from the script that has not been evaluated yet (=~ all the script below .settings.global()). Note: any newVar command using the same id will be ignored if it comes further below the .global() setting command. This is particularly helpful when calling newVar in the Header, the …

var.set

getVar(id).set( value ) (since beta 0.3) or getVar(id).set( function ) Sets the Var element to the specified value. You can pass a function as value, which takes the current value of the Var element as an argument and should return the new value to which it will be updated. Example: [js highlight=”14″ try=”true”]defaultText .print() , …