up Inquisit Language Reference

onScriptBegin attribute

The onScriptBegin attribute specifies commands to be run at the beginning of a script.

Member of

<batch>

Syntax

/ onScriptBegin = { script }

Parameters

Name Type Description
script script

Remarks

Examples

The following code shows how to set a script parameter via the batch element. The parameter needs to be declared in the batch script as well as the task script. In this particular case, participants assigned to group1 run script 'twostepdecisiontask.iqjs' with 'payoff version1', whereas participants assigned to group2 run the same script with 'payoff version 2'.

<batch main1>
/ groups = (1 of 2)
/ onScriptBegin = {
  parameters.version = 1;
}
/ file = "twostepdecisiontask.iqjs"
</batch>

<batch main2>
/ groups = (2 of 2)
/ onScriptBegin = {
  parameters.payOffVersion = 2;
}
/ file = "twostepdecisiontask.iqjs"
</batch>

Copyright Millisecond Software, LLC. All rights reserved.