Millisecond Forums

Infinite branch loop

https://forums.millisecond.com/Topic21095.aspx

By Mirthe - 3/14/2017

I have a question concerning the Branch function.

In my experiment there are 4 practice blocks. The participant needs to complete the first two. The completion of another two practice blocks depends on their performance (mean latency > 2.000 ms or < 80% correct responses). While this branch works, I am now stuck in an infinite loop; after finishing the last block, participants again start the second pair of practice blocks, while the experiment actually needed to end.

Below a part of the syntax.

Can anyone tell me how to solve this problem?

Thank you in advance!

<blockPractice_Consistent1>

/skip = [values.abbruch == 1]

/preinstructions = (Practice_Consistent_1)

/trials = [

1=ready.trial;

2=Consistent_Anderen4;

3=Consistent_Ik2;

</block>

 

<blockPractice_inConsistent1>

/skip = [values.abbruch == 1]

/preinstructions = (Practice_inConsistent)

/postinstructions = (practicefeedback)

/trials = [

1=inConsistent_Anderen1;

2=inConsistent_Ik3;

/branch = [if (expressions.pct_correct < 80 || expressions.mean_rt > 2000)block.practice_consistent2]

/branch = [if (expressions.pct_correct > 80 || expressions.mean_rt < 2000)block.consistent1]

</block>

 

<blockPractice_Consistent2>

/skip = [values.abbruch == 1]

/onblockbegin=[values.ntrials = 0; values.n_correct = 0; values.sum_latency = 0]

/preinstructions = (Practice_Consistent_2)

/trials = [

1=ready.trial;

2=Consistent_Anderen2;

3=Consistent_Ik2;

/branch = [block.practice_inconsistent2]

</block>

 

<blockPractice_inConsistent2>

/skip = [values.abbruch == 1]

/preinstructions = (Practice_inConsistent)

/postinstructions = (practicefeedback)

/trials = [

1=inConsistent_Anderen3;

2=inConsistent_Ik4;

/branch = [block.consistent1]

</block>

 

<blockConsistent1>

/skip = [values.abbruch == 1]

/preinstructions = (Consistent)

/trials = [

1=ready.trial;

2=Consistent_Ik3;

3=Consistent_Ik2;

4=Consistent_Anderen4;

/branch = [block.inconsistent1]

</block>

 

<blockinConsistent1>

/skip = [values.abbruch == 1]

/preinstructions = (inConsistent)

/trials = [

1=inConsistent_Anderen4;

2=inConsistent_Anderen1;

</block>

 

<expt>

/onexptbegin = [values.abbruch = 0]

/blocks = [            1 =Practice_Consistent1;

                                2 =Practice_inConsistent1;

                                3 =Practice_Consistent2;

                                4 =Practice_inConsistent2;

                                5 = Consistent1;

                                6 =inConsistent1]

</expt>


By Dave - 3/15/2017

Mirthe - Wednesday, March 15, 2017
I have a question concerning the Branch function.

In my experiment there are 4 practice blocks. The participant needs to complete the first two. The completion of another two practice blocks depends on their performance (mean latency > 2.000 ms or < 80% correct responses). While this branch works, I am now stuck in an infinite loop; after finishing the last block, participants again start the second pair of practice blocks, while the experiment actually needed to end.

Below a part of the syntax.

Can anyone tell me how to solve this problem?

Thank you in advance!

<blockPractice_Consistent1>

/skip = [values.abbruch == 1]

/preinstructions = (Practice_Consistent_1)

/trials = [

1=ready.trial;

2=Consistent_Anderen4;

3=Consistent_Ik2;

</block>

 

<blockPractice_inConsistent1>

/skip = [values.abbruch == 1]

/preinstructions = (Practice_inConsistent)

/postinstructions = (practicefeedback)

/trials = [

1=inConsistent_Anderen1;

2=inConsistent_Ik3;

/branch = [if (expressions.pct_correct < 80 || expressions.mean_rt > 2000)block.practice_consistent2]

/branch = [if (expressions.pct_correct > 80 || expressions.mean_rt < 2000)block.consistent1]

</block>

 

<blockPractice_Consistent2>

/skip = [values.abbruch == 1]

/onblockbegin=[values.ntrials = 0; values.n_correct = 0; values.sum_latency = 0]

/preinstructions = (Practice_Consistent_2)

/trials = [

1=ready.trial;

2=Consistent_Anderen2;

3=Consistent_Ik2;

/branch = [block.practice_inconsistent2]

</block>

 

<blockPractice_inConsistent2>

/skip = [values.abbruch == 1]

/preinstructions = (Practice_inConsistent)

/postinstructions = (practicefeedback)

/trials = [

1=inConsistent_Anderen3;

2=inConsistent_Ik4;

/branch = [block.consistent1]

</block>

 

<blockConsistent1>

/skip = [values.abbruch == 1]

/preinstructions = (Consistent)

/trials = [

1=ready.trial;

2=Consistent_Ik3;

3=Consistent_Ik2;

4=Consistent_Anderen4;

/branch = [block.inconsistent1]

</block>

 

<blockinConsistent1>

/skip = [values.abbruch == 1]

/preinstructions = (inConsistent)

/trials = [

1=inConsistent_Anderen4;

2=inConsistent_Anderen1;

</block>

 

<expt>

/onexptbegin = [values.abbruch = 0]

/blocks = [            1 =Practice_Consistent1;

                                2 =Practice_inConsistent1;

                                3 =Practice_Consistent2;

                                4 =Practice_inConsistent2;

                                5 = Consistent1;

                                6 =inConsistent1]

</expt>



<expt>
/onexptbegin = [values.abbruch = 0]
/blocks = [            1 =Practice_Consistent1;
                                2 =Practice_inConsistent1;
                                3 =Practice_Consistent2;
                                4 =Practice_inConsistent2;

                                5 = Consistent1;
                                6 =inConsistent1]

</expt>

If you invoke <block practice_consistent2> and <block practice_inconsistent2> *conditionally* via /branch, you should of course *not* run those blocks via the <expt> in addition and unconditionally.
By Mirthe - 3/15/2017

Dave - Wednesday, March 15, 2017
Mirthe - Wednesday, March 15, 2017
I have a question concerning the Branch function.

In my experiment there are 4 practice blocks. The participant needs to complete the first two. The completion of another two practice blocks depends on their performance (mean latency > 2.000 ms or < 80% correct responses). While this branch works, I am now stuck in an infinite loop; after finishing the last block, participants again start the second pair of practice blocks, while the experiment actually needed to end.

Below a part of the syntax.

Can anyone tell me how to solve this problem?

Thank you in advance!

<blockPractice_Consistent1>

/skip = [values.abbruch == 1]

/preinstructions = (Practice_Consistent_1)

/trials = [

1=ready.trial;

2=Consistent_Anderen4;

3=Consistent_Ik2;

</block>

 

<blockPractice_inConsistent1>

/skip = [values.abbruch == 1]

/preinstructions = (Practice_inConsistent)

/postinstructions = (practicefeedback)

/trials = [

1=inConsistent_Anderen1;

2=inConsistent_Ik3;

/branch = [if (expressions.pct_correct < 80 || expressions.mean_rt > 2000)block.practice_consistent2]

/branch = [if (expressions.pct_correct > 80 || expressions.mean_rt < 2000)block.consistent1]

</block>

 

<blockPractice_Consistent2>

/skip = [values.abbruch == 1]

/onblockbegin=[values.ntrials = 0; values.n_correct = 0; values.sum_latency = 0]

/preinstructions = (Practice_Consistent_2)

/trials = [

1=ready.trial;

2=Consistent_Anderen2;

3=Consistent_Ik2;

/branch = [block.practice_inconsistent2]

</block>

 

<blockPractice_inConsistent2>

/skip = [values.abbruch == 1]

/preinstructions = (Practice_inConsistent)

/postinstructions = (practicefeedback)

/trials = [

1=inConsistent_Anderen3;

2=inConsistent_Ik4;

/branch = [block.consistent1]

</block>

 

<blockConsistent1>

/skip = [values.abbruch == 1]

/preinstructions = (Consistent)

/trials = [

1=ready.trial;

2=Consistent_Ik3;

3=Consistent_Ik2;

4=Consistent_Anderen4;

/branch = [block.inconsistent1]

</block>

 

<blockinConsistent1>

/skip = [values.abbruch == 1]

/preinstructions = (inConsistent)

/trials = [

1=inConsistent_Anderen4;

2=inConsistent_Anderen1;

</block>

 

<expt>

/onexptbegin = [values.abbruch = 0]

/blocks = [            1 =Practice_Consistent1;

                                2 =Practice_inConsistent1;

                                3 =Practice_Consistent2;

                                4 =Practice_inConsistent2;

                                5 = Consistent1;

                                6 =inConsistent1]

</expt>



<expt>
/onexptbegin = [values.abbruch = 0]
/blocks = [            1 =Practice_Consistent1;
                                2 =Practice_inConsistent1;
                                3 =Practice_Consistent2;
                                4 =Practice_inConsistent2;

                                5 = Consistent1;
                                6 =inConsistent1]

</expt>

If you invoke <block practice_consistent2> and <block practice_inconsistent2> *conditionally* via /branch, you should of course *not* run those blocks via the <expt> in addition and unconditionally.

Thank you!