PennController for IBEX › Forums › Support › Branching Structure for filtering participants › Reply To: Branching Structure for filtering participants
June 20, 2023 at 7:56 am
#10697
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