timer.set

description

Re(set) timer.

syntax

getTimer(ELEMENT_NAME).set()

example(s)

  • The set command lets user (re)set the duration of the timer element independently of its creation.

@newTimer("time"),
@newScale("mode", "easy", "hard")
@    .button().print().wait().remove()
@    .test.selected("easy")
$    .success( getTimer("time").set(2000) )
$    .failure( getTimer("time").set(1000) )
@,
@newScale("answer", "Answer A", "Answer B")
@    .button().print()
@,
@getTimer("time").start().wait()
@    .remove()
  • The code above gives 2s to answer in the easy mode, but only 1s in the hard mode.