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 …
Wiki Category Archives:
standard.settings.selector
getElement(id).settings.selector( selectorName ) or getElement(id).settings.selector( getSelector(selectorName) ) (since beta 0.3) Since beta 0.3, adds a .settings.selector command to all elements as another method for adding them to a selector. Example: [js highlight=”4,7″ try=”true”]newSelector(“shapes”) , newImage(“square”, “square.png”) .settings.selector(“shapes”) , newImage(“triangle”, “triangle.png”) .settings.selector(“shapes”) , newCanvas(“shapes canvas”, 825, 400) .settings.add( 0, 0, getImage(“square”) ) .settings.add(425, 0, getImage(“triangle”) ) …
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() …
standard.settings.enable
getElement(id).settings.enable() Enables any interactive feature of the element that was previously disabled. Example: [js highlight=”8″ try=”true”] newAudio(“sentence”, “test.mp3”) .settings.once() .print() , newKey(“secret key”, “R”) .wait() , getAudio(“sentence”) .settings.enable() [/js] Prints buttons to play/pause the audio file test_sentence.ogg, and disables those buttons when the file has played through (see ).
standard.settings.disable
getElement(id).settings.disable() Disables any interactive feature of the element. Note: this does not prevent an element that is part of a from being selected. Example: [js highlight=”6″ try=”true”] newAudio(“sentence”, “test.mp3”) .print() .wait() , getAudio(“sentence”) .settings.disable() [/js] Prints buttons to play/pause the audio file test_sentence.ogg, and disables those buttons when the file has played through.
selector.test.selected
getSelector(id).test.selected() or getSelector(id).test.selected( element ) Tests whether an element is selected. When testing an element, remember to use a get* command, as simply typing its ID will fail (ie. test for getImage(“square”), not just “square”) Example: [js highlight=”12″ try=”true”] newImage(“square”, “square.png”) , newImage(“triangle”, “triangle.png”) .settings.before( getImage(“square”) ) .print() , newSelector(“shapes”) .settings.add( getImage(“square”) , getImage(“triangle”) ) …
selector.test.index
getSelector(id).test.index( element ) (since version 1.0) or getSelector(id).test.index( element , index ) (since version 1.0) Tests the index of an element in the selector (starting with 0). If you pass no index, the test will be a success if the element is part of the selector, else a failure. When testing an element, remember to …
selector.settings.shuffle
getSelector(id).settings.shuffle() (deprecated since beta 0.3) or getSelector(id).settings.shuffle( element1, element2, … ) See the action command
selector.settings.once
getSelector(id).settings.once() Disables the selector after the first selection has happened. Example: [js highlight=”9″ try=”true”] newImage(“square”, “square.png”) , newImage(“triangle”, “triangle.png”) .settings.before( getImage(“square”) ) .print() , newSelector(“shapes”) .settings.add( getImage(“square”) , getImage(“triangle”) ) .settings.once() [/js] Adds two images side by side and a button to click below them. Any selection is definitive: further clicks will not move the …
selector.settings.log
getSelector(id).settings.log() or getSelector(id).settings.log(“first”) (since beta 0.4) or getSelector(id).settings.log(“last”) (since beta 0.4) or getSelector(id).settings.log(“all”) A line will be added to the results file when an element is selected indicating its reference name and the timestamp of selection. Leaving the parentheses blank or calling “last” will log the last selection. Calling “first” will log the first selection. …