Millisecond Forums

How to do branching at the beginning to run two different experiments?

https://www.millisecond.com/forums/Topic16773.aspx

By MWirth - 7/22/2015

Hello

Currently I am trying to program an n-back task for a study. We want to test two different age groups and to adjust the difficulty: The older ones should only do the 2-back task and the younger ones only the 3-back task. At the beginning we want to ask the age group (with a checkbox)  and depending on their answer they should run a whole different experiment (different instructions, practice blocks &  trainingsblocks). I searched on the "Inquisit Help Page but couldn't find any clear instruction to write the syntax. 

By now, i  have the checkbox and the survey page:  

<checkboxes agegroup>
/ caption="Bitte waehlen Sie ihre Altersgruppe:"
/fontstyle = ("Arial", 3.05%, true, false, false, false, 5, 0)
/ txcolor = (0, 0, 0)
/ required = true
/ options=("20-35", "60-75")
/ range = (1, 1)
/ position= (30, 50)
/responsefontstyle = ("Arial", 3.05%, true, false, false, false, 5, 0)
/ txcolor = (0, 0, 0)
</checkboxes>


<surveypage Start>
/questions= [1=Agegroup]
/ nextlabel = ("Weiter")
/ navigationbuttonfontstyle = ("Arial", 3.05%, true, false, false, false, 5, 0)
/ navigationbuttonsize = (10%, 2%)
/ nextbuttonposition = (60%, 70%)
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ branch = [if(checkboxes.agegroup.response =="20-35") ???]
/ branch = [if(checkboxes.agegroup.response =="60-75") ???]

??? ---> this is the part where I am wondering which "trail" I should take. Depending on the age group the participants have to work either one of two groups of blocks in a specific order (InstructionsYoung, PracticeYoung, TrainingYoung /// or: InstructionsOld, PracticeOld, TrainingOld) 

Is it possible to create two different experiments and show the page before and select the experiment type after answering the question or do I have to do the branching in one experiment?

I hope my descriptions are clear enough and that somebody can help me. Thank you! :)


By Dave - 7/23/2015

The best way to do this is in a single <expt>. Specify *all* the <block>s (for both groups) in its /blocks attribute. The 1st block is where you ask your age question. Then use /skip attributes in the remaining <blocks> to only run those that apply. Simple example:

<expt>
/ blocks = [1=groupselection; 2=group1block1; 3=group1block2; 4=group2block1; 5=group2block2; 6=group2block3]
</expt>

<block groupselection>
/ trials = [1=groupquestion]
</block>

<surveypage groupquestion>
/ questions = [1=group]
</surveypage>

<radiobuttons group>
/ options = ("Group 1", "Group 2")
/ optionvalues = ("1", "2")
</radiobuttons>

<block group1block1>
/ skip = [radiobuttons.group.response!="1"]
/ trials = [1=mytrial]
</block>

<block group1block2>
/ skip = [radiobuttons.group.response!="1"]
/ trials = [1=mytrial]
</block>

<block group2block1>
/ skip = [radiobuttons.group.response!="2"]
/ trials = [1=mytrial]
</block>

<block group2block2>
/ skip = [radiobuttons.group.response!="2"]
/ trials = [1=mytrial]
</block>

<block group2block3>
/ skip = [radiobuttons.group.response!="2"]
/ trials = [1=mytrial]
</block>

<trial mytrial>
/ stimulusframes = [1=mytext]
/ validresponse = (57)
</trial>

<text mytext>
/ items = ("This is block <%script.currentblock%>")
</text>

Hope this helps.
By MWirth - 7/23/2015

Thank you very much for your quick help, now I have an idea how to structure the syntax. I'll try and hopefully I'll make it work :)