The new PCIbex Farm is here! Be sure to check out all of its new features and changes.

Link Search Menu Expand Document


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.




  • getFunction(ELEMENT_NAME) value )


  • NOTE: remember that the expression you pass as the test value is executed at the very beginning of the experiment. So calling getFunction(“myFunction”) ) will test that the function returns the timestamp corresponding to the beginning of the experiment. In this case, you may consider rewriting your function so it takes care of testing and returns true or false in consequence.


@newFunction("timestampMultipleOfThree", () => % 3 )
@newText("missed", "Bad luck, try again!")
@    .color("red")
@    .bold()
@newButton("myButton", "Click me")
@    .print()
@    .wait(
@        getFunction("timestampMultipleOfThree")
$            .success( getText("missed").remove() )
$            .failure( getText("missed").print() )
@    )
  • Adds a button to the screen whose clicks are validated only if happening at a time when the timestamp is not a multiple of 3 (i.e., the modulo value returned by the function is different from 0).