complex branching


Author
Message
nc
nc
nc
posted 4 Years Ago HOT
Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)
Group: Forum Members
Posts: 39, Visits: 108
Hi all, I'm trying to create complex branching where a certain block appears once the subject either (a) gives 2 incorrect responses on the first trial; (b) gives at least 2 correct answers on the first trial and at least 2 incorrect answers on the second trial; (c) gives at least 2 correct answers on the 2nd trial and at least 2 incorrect answers on the 3rd trial....and so on. Here is my code, and it's not working. Can anyone help me understand what I'm doing wrong?

<block test>
/trials = [1=one]
/branch = [
    if (trial.one.totalerrorcount >=2) block.end
]
/branch = [
     if (trial.one.totalcorrectcount >=2 && trial.two.totalerrorcount >=2) block.end
]
/branch = [
     if (trial.two.totalcorrectcount >=2 && trial.three.totalerrorcount >=2) block.end
]
/branch = [
     if (trial.three.totalcorrectcount >=2 && trial.four.totalerrorcount >=2) block.end
]
/branch = [
     if (trial.four.totalcorrectcount >=2 && trial.five.totalerrorcount >=2) block.end
]
/branch = [
     if (trial.five.totalcorrectcount >=2 && trial.six.totalerrorcount >=2) block.end
]
/branch = [
     if (trial.six.totalcorrectcount >=2) block.end
]
</block>
nc
nc
Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)
Group: Forum Members
Posts: 39, Visits: 108
here's an example of one of the relevant trials:

<trial one>
/ stimulusframes = [1=one, plus_one, minus_one, try_again,
pond, duck_1_a, duck_1_b, duck_2_a, duck_2_b, duck_3_a, duck_3_b, duck_4_a, duck_4_b, duck_5_a, duck_5_b,
pond]
/ inputdevice = dragdrop
/ showmousecursor = true
/droptargets = (pond)
/ validresponse = (plus_one, minus_one, try_again)
/ correctresponse = (plus_one)
/ontrialbegin=[
    picture.duck_1_a.hposition=24%;
    picture.duck_1_a.vposition=45%;
    picture.duck_1_b.hposition=5%;
    picture.duck_1_b.vposition=30%;
    picture.duck_2_a.hposition=20%;
    picture.duck_2_a.vposition=30%;
    picture.duck_2_b.hposition=15%;
    picture.duck_2_b.vposition=40%;
    picture.duck_3_a.hposition=25%;
    picture.duck_3_a.vposition=55%;
    picture.duck_3_b.hposition=5%;
    picture.duck_3_b.vposition=20%;
    picture.duck_4_a.hposition=10%;
    picture.duck_4_a.vposition=35%;
    picture.duck_4_b.hposition=20%;
    picture.duck_4_b.vposition=35%;
    picture.duck_5_a.hposition=30%;
    picture.duck_5_a.vposition=55%;
    picture.duck_5_b.hposition=13%]
/branch = [if (trial.one.response == "try_again") trial.one]
/branch = [if (trial.one.response == "minus_one") trial.one]
/branch = [if (trial.one.response == "plus_one") trial.three]
</trial>
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
nc - 6/27/2020
here's an example of one of the relevant trials:

<trial one>
/ stimulusframes = [1=one, plus_one, minus_one, try_again,
pond, duck_1_a, duck_1_b, duck_2_a, duck_2_b, duck_3_a, duck_3_b, duck_4_a, duck_4_b, duck_5_a, duck_5_b,
pond]
/ inputdevice = dragdrop
/ showmousecursor = true
/droptargets = (pond)
/ validresponse = (plus_one, minus_one, try_again)
/ correctresponse = (plus_one)
/ontrialbegin=[
    picture.duck_1_a.hposition=24%;
    picture.duck_1_a.vposition=45%;
    picture.duck_1_b.hposition=5%;
    picture.duck_1_b.vposition=30%;
    picture.duck_2_a.hposition=20%;
    picture.duck_2_a.vposition=30%;
    picture.duck_2_b.hposition=15%;
    picture.duck_2_b.vposition=40%;
    picture.duck_3_a.hposition=25%;
    picture.duck_3_a.vposition=55%;
    picture.duck_3_b.hposition=5%;
    picture.duck_3_b.vposition=20%;
    picture.duck_4_a.hposition=10%;
    picture.duck_4_a.vposition=35%;
    picture.duck_4_b.hposition=20%;
    picture.duck_4_b.vposition=35%;
    picture.duck_5_a.hposition=30%;
    picture.duck_5_a.vposition=55%;
    picture.duck_5_b.hposition=13%]
/branch = [if (trial.one.response == "try_again") trial.one]
/branch = [if (trial.one.response == "minus_one") trial.one]
/branch = [if (trial.one.response == "plus_one") trial.three]
</trial>

/branch attributes at the <block> level are executed when that block ends, not sometime in the middle of the block, while the block is still running trials. It's not clear at all from the snippets you posted when the block ends.

E.g. if you want the block to immediately terminate after two errors in <trial one>, you need to put some /stop logic in the <block> to do that etc.
Edited 4 Years Ago by Dave
nc
nc
Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)
Group: Forum Members
Posts: 39, Visits: 108
Dave - 6/29/2020
nc - 6/27/2020
here's an example of one of the relevant trials:

<trial one>
/ stimulusframes = [1=one, plus_one, minus_one, try_again,
pond, duck_1_a, duck_1_b, duck_2_a, duck_2_b, duck_3_a, duck_3_b, duck_4_a, duck_4_b, duck_5_a, duck_5_b,
pond]
/ inputdevice = dragdrop
/ showmousecursor = true
/droptargets = (pond)
/ validresponse = (plus_one, minus_one, try_again)
/ correctresponse = (plus_one)
/ontrialbegin=[
    picture.duck_1_a.hposition=24%;
    picture.duck_1_a.vposition=45%;
    picture.duck_1_b.hposition=5%;
    picture.duck_1_b.vposition=30%;
    picture.duck_2_a.hposition=20%;
    picture.duck_2_a.vposition=30%;
    picture.duck_2_b.hposition=15%;
    picture.duck_2_b.vposition=40%;
    picture.duck_3_a.hposition=25%;
    picture.duck_3_a.vposition=55%;
    picture.duck_3_b.hposition=5%;
    picture.duck_3_b.vposition=20%;
    picture.duck_4_a.hposition=10%;
    picture.duck_4_a.vposition=35%;
    picture.duck_4_b.hposition=20%;
    picture.duck_4_b.vposition=35%;
    picture.duck_5_a.hposition=30%;
    picture.duck_5_a.vposition=55%;
    picture.duck_5_b.hposition=13%]
/branch = [if (trial.one.response == "try_again") trial.one]
/branch = [if (trial.one.response == "minus_one") trial.one]
/branch = [if (trial.one.response == "plus_one") trial.three]
</trial>

/branch attributes at the <block> level are executed when that block ends, not sometime in the middle of the block, while the block is still running trials. It's not clear at all from the snippets you posted when the block ends.

E.g. if you want the block to immediately terminate after two errors in <trial one>, you need to put some /stop logic in the <block> to do that etc.

nc
nc
Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)
Group: Forum Members
Posts: 39, Visits: 108
Thank you for the quick reply. I set up the stop logic like this, but it still doesn't seem to be working:
<block test>
/trials = [1=one]
/stop = [
    (trial.one.totalerrorcount >=2);
    (trial.one.totalcorrectcount >=2 && trial.two.totalerrorcount >=2);
    (trial.two.totalcorrectcount >=2 && trial.three.totalerrorcount >=2);
    (trial.three.totalcorrectcount >=2 && trial.four.totalerrorcount >=2);
    (trial.four.totalcorrectcount >=2 && trial.five.totalerrorcount >=2);
    (trial.five.totalcorrectcount >=2 && trial.six.totalerrorcount >=2);
    (trial.six.totalcorrectcount >=2)]
</block>
in particular, it seems like the expressions with && are the ones not being properly evaluated. Any advice?
nc - 6/29/2020
Dave - 6/29/2020
nc - 6/27/2020
here's an example of one of the relevant trials:

<trial one>
/ stimulusframes = [1=one, plus_one, minus_one, try_again,
pond, duck_1_a, duck_1_b, duck_2_a, duck_2_b, duck_3_a, duck_3_b, duck_4_a, duck_4_b, duck_5_a, duck_5_b,
pond]
/ inputdevice = dragdrop
/ showmousecursor = true
/droptargets = (pond)
/ validresponse = (plus_one, minus_one, try_again)
/ correctresponse = (plus_one)
/ontrialbegin=[
    picture.duck_1_a.hposition=24%;
    picture.duck_1_a.vposition=45%;
    picture.duck_1_b.hposition=5%;
    picture.duck_1_b.vposition=30%;
    picture.duck_2_a.hposition=20%;
    picture.duck_2_a.vposition=30%;
    picture.duck_2_b.hposition=15%;
    picture.duck_2_b.vposition=40%;
    picture.duck_3_a.hposition=25%;
    picture.duck_3_a.vposition=55%;
    picture.duck_3_b.hposition=5%;
    picture.duck_3_b.vposition=20%;
    picture.duck_4_a.hposition=10%;
    picture.duck_4_a.vposition=35%;
    picture.duck_4_b.hposition=20%;
    picture.duck_4_b.vposition=35%;
    picture.duck_5_a.hposition=30%;
    picture.duck_5_a.vposition=55%;
    picture.duck_5_b.hposition=13%]
/branch = [if (trial.one.response == "try_again") trial.one]
/branch = [if (trial.one.response == "minus_one") trial.one]
/branch = [if (trial.one.response == "plus_one") trial.three]
</trial>

/branch attributes at the <block> level are executed when that block ends, not sometime in the middle of the block, while the block is still running trials. It's not clear at all from the snippets you posted when the block ends.

E.g. if you want the block to immediately terminate after two errors in <trial one>, you need to put some /stop logic in the <block> to do that etc.

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
nc - 6/29/2020
Thank you for the quick reply. I set up the stop logic like this, but it still doesn't seem to be working:
<block test>
/trials = [1=one]
/stop = [
    (trial.one.totalerrorcount >=2);
    (trial.one.totalcorrectcount >=2 && trial.two.totalerrorcount >=2);
    (trial.two.totalcorrectcount >=2 && trial.three.totalerrorcount >=2);
    (trial.three.totalcorrectcount >=2 && trial.four.totalerrorcount >=2);
    (trial.four.totalcorrectcount >=2 && trial.five.totalerrorcount >=2);
    (trial.five.totalcorrectcount >=2 && trial.six.totalerrorcount >=2);
    (trial.six.totalcorrectcount >=2)]
</block>
in particular, it seems like the expressions with && are the ones not being properly evaluated. Any advice?
nc - 6/29/2020
Dave - 6/29/2020
nc - 6/27/2020
here's an example of one of the relevant trials:

<trial one>
/ stimulusframes = [1=one, plus_one, minus_one, try_again,
pond, duck_1_a, duck_1_b, duck_2_a, duck_2_b, duck_3_a, duck_3_b, duck_4_a, duck_4_b, duck_5_a, duck_5_b,
pond]
/ inputdevice = dragdrop
/ showmousecursor = true
/droptargets = (pond)
/ validresponse = (plus_one, minus_one, try_again)
/ correctresponse = (plus_one)
/ontrialbegin=[
    picture.duck_1_a.hposition=24%;
    picture.duck_1_a.vposition=45%;
    picture.duck_1_b.hposition=5%;
    picture.duck_1_b.vposition=30%;
    picture.duck_2_a.hposition=20%;
    picture.duck_2_a.vposition=30%;
    picture.duck_2_b.hposition=15%;
    picture.duck_2_b.vposition=40%;
    picture.duck_3_a.hposition=25%;
    picture.duck_3_a.vposition=55%;
    picture.duck_3_b.hposition=5%;
    picture.duck_3_b.vposition=20%;
    picture.duck_4_a.hposition=10%;
    picture.duck_4_a.vposition=35%;
    picture.duck_4_b.hposition=20%;
    picture.duck_4_b.vposition=35%;
    picture.duck_5_a.hposition=30%;
    picture.duck_5_a.vposition=55%;
    picture.duck_5_b.hposition=13%]
/branch = [if (trial.one.response == "try_again") trial.one]
/branch = [if (trial.one.response == "minus_one") trial.one]
/branch = [if (trial.one.response == "plus_one") trial.three]
</trial>

/branch attributes at the <block> level are executed when that block ends, not sometime in the middle of the block, while the block is still running trials. It's not clear at all from the snippets you posted when the block ends.

E.g. if you want the block to immediately terminate after two errors in <trial one>, you need to put some /stop logic in the <block> to do that etc.

> it seems like the expressions with && are the ones not being properly evaluated

What makes you think that, please?
nc
nc
Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)
Group: Forum Members
Posts: 39, Visits: 108
the block doesn't end when there are 2 correct responses on trial 'three' and 2 incorrect on trial 'four', for example.
Dave - 6/29/2020
nc - 6/29/2020
Thank you for the quick reply. I set up the stop logic like this, but it still doesn't seem to be working:
<block test>
/trials = [1=one]
/stop = [
    (trial.one.totalerrorcount >=2);
    (trial.one.totalcorrectcount >=2 && trial.two.totalerrorcount >=2);
    (trial.two.totalcorrectcount >=2 && trial.three.totalerrorcount >=2);
    (trial.three.totalcorrectcount >=2 && trial.four.totalerrorcount >=2);
    (trial.four.totalcorrectcount >=2 && trial.five.totalerrorcount >=2);
    (trial.five.totalcorrectcount >=2 && trial.six.totalerrorcount >=2);
    (trial.six.totalcorrectcount >=2)]
</block>
in particular, it seems like the expressions with && are the ones not being properly evaluated. Any advice?
nc - 6/29/2020
Dave - 6/29/2020
nc - 6/27/2020
here's an example of one of the relevant trials:

<trial one>
/ stimulusframes = [1=one, plus_one, minus_one, try_again,
pond, duck_1_a, duck_1_b, duck_2_a, duck_2_b, duck_3_a, duck_3_b, duck_4_a, duck_4_b, duck_5_a, duck_5_b,
pond]
/ inputdevice = dragdrop
/ showmousecursor = true
/droptargets = (pond)
/ validresponse = (plus_one, minus_one, try_again)
/ correctresponse = (plus_one)
/ontrialbegin=[
    picture.duck_1_a.hposition=24%;
    picture.duck_1_a.vposition=45%;
    picture.duck_1_b.hposition=5%;
    picture.duck_1_b.vposition=30%;
    picture.duck_2_a.hposition=20%;
    picture.duck_2_a.vposition=30%;
    picture.duck_2_b.hposition=15%;
    picture.duck_2_b.vposition=40%;
    picture.duck_3_a.hposition=25%;
    picture.duck_3_a.vposition=55%;
    picture.duck_3_b.hposition=5%;
    picture.duck_3_b.vposition=20%;
    picture.duck_4_a.hposition=10%;
    picture.duck_4_a.vposition=35%;
    picture.duck_4_b.hposition=20%;
    picture.duck_4_b.vposition=35%;
    picture.duck_5_a.hposition=30%;
    picture.duck_5_a.vposition=55%;
    picture.duck_5_b.hposition=13%]
/branch = [if (trial.one.response == "try_again") trial.one]
/branch = [if (trial.one.response == "minus_one") trial.one]
/branch = [if (trial.one.response == "plus_one") trial.three]
</trial>

/branch attributes at the <block> level are executed when that block ends, not sometime in the middle of the block, while the block is still running trials. It's not clear at all from the snippets you posted when the block ends.

E.g. if you want the block to immediately terminate after two errors in <trial one>, you need to put some /stop logic in the <block> to do that etc.

> it seems like the expressions with && are the ones not being properly evaluated

What makes you think that, please?

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
nc - 6/29/2020
the block doesn't end when there are 2 correct responses on trial 'three' and 2 incorrect on trial 'four', for example.
Dave - 6/29/2020
nc - 6/29/2020
Thank you for the quick reply. I set up the stop logic like this, but it still doesn't seem to be working:
<block test>
/trials = [1=one]
/stop = [
    (trial.one.totalerrorcount >=2);
    (trial.one.totalcorrectcount >=2 && trial.two.totalerrorcount >=2);
    (trial.two.totalcorrectcount >=2 && trial.three.totalerrorcount >=2);
    (trial.three.totalcorrectcount >=2 && trial.four.totalerrorcount >=2);
    (trial.four.totalcorrectcount >=2 && trial.five.totalerrorcount >=2);
    (trial.five.totalcorrectcount >=2 && trial.six.totalerrorcount >=2);
    (trial.six.totalcorrectcount >=2)]
</block>
in particular, it seems like the expressions with && are the ones not being properly evaluated. Any advice?
nc - 6/29/2020
Dave - 6/29/2020
nc - 6/27/2020
here's an example of one of the relevant trials:

<trial one>
/ stimulusframes = [1=one, plus_one, minus_one, try_again,
pond, duck_1_a, duck_1_b, duck_2_a, duck_2_b, duck_3_a, duck_3_b, duck_4_a, duck_4_b, duck_5_a, duck_5_b,
pond]
/ inputdevice = dragdrop
/ showmousecursor = true
/droptargets = (pond)
/ validresponse = (plus_one, minus_one, try_again)
/ correctresponse = (plus_one)
/ontrialbegin=[
    picture.duck_1_a.hposition=24%;
    picture.duck_1_a.vposition=45%;
    picture.duck_1_b.hposition=5%;
    picture.duck_1_b.vposition=30%;
    picture.duck_2_a.hposition=20%;
    picture.duck_2_a.vposition=30%;
    picture.duck_2_b.hposition=15%;
    picture.duck_2_b.vposition=40%;
    picture.duck_3_a.hposition=25%;
    picture.duck_3_a.vposition=55%;
    picture.duck_3_b.hposition=5%;
    picture.duck_3_b.vposition=20%;
    picture.duck_4_a.hposition=10%;
    picture.duck_4_a.vposition=35%;
    picture.duck_4_b.hposition=20%;
    picture.duck_4_b.vposition=35%;
    picture.duck_5_a.hposition=30%;
    picture.duck_5_a.vposition=55%;
    picture.duck_5_b.hposition=13%]
/branch = [if (trial.one.response == "try_again") trial.one]
/branch = [if (trial.one.response == "minus_one") trial.one]
/branch = [if (trial.one.response == "plus_one") trial.three]
</trial>

/branch attributes at the <block> level are executed when that block ends, not sometime in the middle of the block, while the block is still running trials. It's not clear at all from the snippets you posted when the block ends.

E.g. if you want the block to immediately terminate after two errors in <trial one>, you need to put some /stop logic in the <block> to do that etc.

> it seems like the expressions with && are the ones not being properly evaluated

What makes you think that, please?

Please provide the full script including any and all external files it requires to run then
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
Dave - 6/29/2020
nc - 6/29/2020
the block doesn't end when there are 2 correct responses on trial 'three' and 2 incorrect on trial 'four', for example.
Dave - 6/29/2020
nc - 6/29/2020
Thank you for the quick reply. I set up the stop logic like this, but it still doesn't seem to be working:
<block test>
/trials = [1=one]
/stop = [
    (trial.one.totalerrorcount >=2);
    (trial.one.totalcorrectcount >=2 && trial.two.totalerrorcount >=2);
    (trial.two.totalcorrectcount >=2 && trial.three.totalerrorcount >=2);
    (trial.three.totalcorrectcount >=2 && trial.four.totalerrorcount >=2);
    (trial.four.totalcorrectcount >=2 && trial.five.totalerrorcount >=2);
    (trial.five.totalcorrectcount >=2 && trial.six.totalerrorcount >=2);
    (trial.six.totalcorrectcount >=2)]
</block>
in particular, it seems like the expressions with && are the ones not being properly evaluated. Any advice?
nc - 6/29/2020
Dave - 6/29/2020
nc - 6/27/2020
here's an example of one of the relevant trials:

<trial one>
/ stimulusframes = [1=one, plus_one, minus_one, try_again,
pond, duck_1_a, duck_1_b, duck_2_a, duck_2_b, duck_3_a, duck_3_b, duck_4_a, duck_4_b, duck_5_a, duck_5_b,
pond]
/ inputdevice = dragdrop
/ showmousecursor = true
/droptargets = (pond)
/ validresponse = (plus_one, minus_one, try_again)
/ correctresponse = (plus_one)
/ontrialbegin=[
    picture.duck_1_a.hposition=24%;
    picture.duck_1_a.vposition=45%;
    picture.duck_1_b.hposition=5%;
    picture.duck_1_b.vposition=30%;
    picture.duck_2_a.hposition=20%;
    picture.duck_2_a.vposition=30%;
    picture.duck_2_b.hposition=15%;
    picture.duck_2_b.vposition=40%;
    picture.duck_3_a.hposition=25%;
    picture.duck_3_a.vposition=55%;
    picture.duck_3_b.hposition=5%;
    picture.duck_3_b.vposition=20%;
    picture.duck_4_a.hposition=10%;
    picture.duck_4_a.vposition=35%;
    picture.duck_4_b.hposition=20%;
    picture.duck_4_b.vposition=35%;
    picture.duck_5_a.hposition=30%;
    picture.duck_5_a.vposition=55%;
    picture.duck_5_b.hposition=13%]
/branch = [if (trial.one.response == "try_again") trial.one]
/branch = [if (trial.one.response == "minus_one") trial.one]
/branch = [if (trial.one.response == "plus_one") trial.three]
</trial>

/branch attributes at the <block> level are executed when that block ends, not sometime in the middle of the block, while the block is still running trials. It's not clear at all from the snippets you posted when the block ends.

E.g. if you want the block to immediately terminate after two errors in <trial one>, you need to put some /stop logic in the <block> to do that etc.

> it seems like the expressions with && are the ones not being properly evaluated

What makes you think that, please?

Please provide the full script including any and all external files it requires to run then

Assuming the /branch attributes in your <trial one> snippet you posted previously are representative and accurate,

/branch = [if (trial.one.response == "try_again") trial.one]
/branch = [if (trial.one.response == "minus_one") trial.one]
/branch = [if (trial.one.response == "plus_one") trial.three]

notice that you branch to trial.three, not trial.two here -- so it would seem that there are situations where trial.two (and possibly other trials)  is never run, which would explain why the a stop condition like

(trial.one.totalcorrectcount >=2 && trial.two.totalerrorcount >=2);
or
(trial.two.totalcorrectcount >=2 && trial.three.totalerrorcount >=2);

doesn't fire.

But it's impossible for me to say without actually being able to examine the code in context as well as a sufficiently detailed description of how exactly the script is intended to behave.


nc
nc
Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)
Group: Forum Members
Posts: 39, Visits: 108
Dave - 6/29/2020
nc - 6/29/2020
the block doesn't end when there are 2 correct responses on trial 'three' and 2 incorrect on trial 'four', for example.
Dave - 6/29/2020
nc - 6/29/2020
Thank you for the quick reply. I set up the stop logic like this, but it still doesn't seem to be working:
<block test>
/trials = [1=one]
/stop = [
    (trial.one.totalerrorcount >=2);
    (trial.one.totalcorrectcount >=2 && trial.two.totalerrorcount >=2);
    (trial.two.totalcorrectcount >=2 && trial.three.totalerrorcount >=2);
    (trial.three.totalcorrectcount >=2 && trial.four.totalerrorcount >=2);
    (trial.four.totalcorrectcount >=2 && trial.five.totalerrorcount >=2);
    (trial.five.totalcorrectcount >=2 && trial.six.totalerrorcount >=2);
    (trial.six.totalcorrectcount >=2)]
</block>
in particular, it seems like the expressions with && are the ones not being properly evaluated. Any advice?
nc - 6/29/2020
Dave - 6/29/2020
nc - 6/27/2020
here's an example of one of the relevant trials:

<trial one>
/ stimulusframes = [1=one, plus_one, minus_one, try_again,
pond, duck_1_a, duck_1_b, duck_2_a, duck_2_b, duck_3_a, duck_3_b, duck_4_a, duck_4_b, duck_5_a, duck_5_b,
pond]
/ inputdevice = dragdrop
/ showmousecursor = true
/droptargets = (pond)
/ validresponse = (plus_one, minus_one, try_again)
/ correctresponse = (plus_one)
/ontrialbegin=[
    picture.duck_1_a.hposition=24%;
    picture.duck_1_a.vposition=45%;
    picture.duck_1_b.hposition=5%;
    picture.duck_1_b.vposition=30%;
    picture.duck_2_a.hposition=20%;
    picture.duck_2_a.vposition=30%;
    picture.duck_2_b.hposition=15%;
    picture.duck_2_b.vposition=40%;
    picture.duck_3_a.hposition=25%;
    picture.duck_3_a.vposition=55%;
    picture.duck_3_b.hposition=5%;
    picture.duck_3_b.vposition=20%;
    picture.duck_4_a.hposition=10%;
    picture.duck_4_a.vposition=35%;
    picture.duck_4_b.hposition=20%;
    picture.duck_4_b.vposition=35%;
    picture.duck_5_a.hposition=30%;
    picture.duck_5_a.vposition=55%;
    picture.duck_5_b.hposition=13%]
/branch = [if (trial.one.response == "try_again") trial.one]
/branch = [if (trial.one.response == "minus_one") trial.one]
/branch = [if (trial.one.response == "plus_one") trial.three]
</trial>

/branch attributes at the <block> level are executed when that block ends, not sometime in the middle of the block, while the block is still running trials. It's not clear at all from the snippets you posted when the block ends.

E.g. if you want the block to immediately terminate after two errors in <trial one>, you need to put some /stop logic in the <block> to do that etc.

> it seems like the expressions with && are the ones not being properly evaluated

What makes you think that, please?

Please provide the full script including any and all external files it requires to run then

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search