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() …

function.test.is

getFunction(id).test.is() or getFunction(id).test.is( value ) Executes the function and tests the value it returns. If you specify no value, it yields success if the return value is 0, null, undefined or false. NOTE: remember that the expression you pass as the test value is executed at the very beginning of the experiment. So calling getFunction(“myFunction”).test.is( …

function.call

getFunction(id).call() Executes the function. Example: [js try=”true” highlight=”12-13″] newFunction(“setKeyTime”, function(){ this.keyTime = Date.now(); }), newFunction(“keyTimerDelay”, function(){ return Date.now() – this.keyTime > 10; }), newButton(“Start”, “Start”) .print() .wait(), newText(“instrutions”, “Quick, you have one second to press the T key!”) .print(), newTimer(“quick”, 1010) .start(), newKey(“t”, “T”) .wait(), getFunction(“setKeyTime”) .call(), getTimer(“quick”) .wait(“first”), getFunction(“keyTimerDelay”) .test.is(true) .success( newText(“success”, “Good job!”) …