Error message

  • Notice: Undefined index: jspies in drupal_theme_initialize() (line 100 of /home/iat/
  • Notice: Trying to get property of non-object in _drupal_theme_initialize() (line 146 of /home/iat/
  • Notice: Trying to get property of non-object in _theme_load_registry() (line 335 of /home/iat/
  • Notice: Undefined index: jspies in theme_get_setting() (line 1440 of /home/iat/

Script Branch

Is current?: 

Sometimes the researcher will want to branch based on more than the random criteria that a group branch can offer.  For these situations, the script branch is your best option.  It can order tasks in virtually any way that the researcher could desire.  The script branch is declared in the <Definitions> section of the experiment file, unlike group branches.  In the <Map> section, you just need <Branch id="myBranchId" type="script" />   to call the branch.   Below is an example that presents different tasks based on how the participant answered an earlier survey.  The exp file posed below uses files from the sample study at


    <Branch id="dependency" type="script">
        //An array of the possible answers to the variable that we are going to read
        String[] values = {"1", "2", "3"}; 

        dropdown = get("dropdown"); //"dropdown" is the task id in the <definitions> section.  Responses in the dropdown task will determine which tasks the branch shows

        //If the value of dditem1 in task "dropdown" is "1","2",or "3" then this will give tasks "checkbox" and "radiogrid". Otherwise it will give task "radiobutton"
        if (Arrays.asList(values).contains(dropdown.results{"dditem1"})) {
        task = get("checkbox");
        task.setParent(get("dependency"));  //change "dependency" to whatever you name your script branch
        task2 = get("radiogrid");
        return task;
       task = get("radiobutton");
        return task;