Reply To: Branching Structure for filtering participants

PennController for IBEX Forums Support Branching Structure for filtering participants Reply To: Branching Structure for filtering participants

#10697
Jeremy
Keymaster

Hi AY,

Here’s a basic illustration of what you described:

// This will be included at the beginning of every trial
Header(
    newVar("error_count",0) // set the initial value to 0
        .global()           // make sure the Var element is global
        .test.is(v=>v<3)    // the value should be below 3
        .failure(           // if not, then block the script here
            newText("Sorry, too many mistakes. The end.").center().print()
            ,
            newButton().wait() // will wait forever
        )
    ,
    defaultScale.button().print().wait()
)

// 8 dummy trials
newTrial( newScale("dummy", "Yes", "No").test.selected("Yes").failure(getVar("error_count").set(v=>v+1)) )
newTrial( newScale("dummy", "Yes", "No").test.selected("Yes").failure(getVar("error_count").set(v=>v+1)) )
newTrial( newScale("dummy", "Yes", "No").test.selected("Yes").failure(getVar("error_count").set(v=>v+1)) )
newTrial( newScale("dummy", "Yes", "No").test.selected("Yes").failure(getVar("error_count").set(v=>v+1)) )
newTrial( newScale("dummy", "Yes", "No").test.selected("Yes").failure(getVar("error_count").set(v=>v+1)) )
newTrial( newScale("dummy", "Yes", "No").test.selected("Yes").failure(getVar("error_count").set(v=>v+1)) )
newTrial( newScale("dummy", "Yes", "No").test.selected("Yes").failure(getVar("error_count").set(v=>v+1)) )
newTrial( newScale("dummy", "Yes", "No").test.selected("Yes").failure(getVar("error_count").set(v=>v+1)) )

Jeremy