complex branching


Author
Message
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
nc - 6/29/2020
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

Attachments
duck_1.png (176 views, 58.00 KB)
duck_2.png (168 views, 59.00 KB)
pond.png (159 views, 403.00 KB)
give_n.iqx (178 views, 12.00 KB)
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
Also to reply to a previous comment: the branching you pointed to is intentional (3 should come after 1). It is possible that trial 2 would never be run. nonetheless, even when I try two correct on 3 and 2 incorrect on 4, it still doesn't end the block.
nc - 6/29/2020
nc - 6/29/2020
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

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

Thanks for the script. I asked you for some kind of description of how that script is actually supposed to behave. That isn't evident from the code. Can I get that please?

A slightly revised version based on some guesswork is attached. I fixed a few errors (e.g. some /branch in trial.two was relying on the response to trial.three, not the response to trial.two) and added a few additional columns to the data file and some expression so you can see exactly which stop condition fired.

Attachments
give_n.iqx (156 views, 13.00 KB)
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
I'm not sure what kind of description I should provide. It's meant to function as a counting task to be administered to children. They are asked to drag the ducks into a pond. There is a demonstration trial first, and then they are asked to place successive numbers of ducks into a pond (e.g., 1 duck, then 3 ducks, then 4, then 5). It's titrated, so if they get a number wrong, they go up a number. If they get it right, they go down a number. An adult grades their answers by either pressing "next' or "previous" (depending on whether the child got the answer right or wrong). The experiment is meant to end when children either a) fail the 1 trial twice, b) fail any given trial twice, but succeed on the previous trial twice, or c) succeed on the last trial twice.
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
nc - 6/30/2020
I'm not sure what kind of description I should provide. It's meant to function as a counting task to be administered to children. They are asked to drag the ducks into a pond. There is a demonstration trial first, and then they are asked to place successive numbers of ducks into a pond (e.g., 1 duck, then 3 ducks, then 4, then 5). It's titrated, so if they get a number wrong, they go up a number. If they get it right, they go down a number. An adult grades their answers by either pressing "next' or "previous" (depending on whether the child got the answer right or wrong). The experiment is meant to end when children either a) fail the 1 trial twice, b) fail any given trial twice, but succeed on the previous trial twice, or c) succeed on the last trial twice.

Sorry, I meant to say - if they get a number wrong, they go down a number. If they get it right, they go up a number*
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
nc - 6/30/2020
nc - 6/30/2020
I'm not sure what kind of description I should provide. It's meant to function as a counting task to be administered to children. They are asked to drag the ducks into a pond. There is a demonstration trial first, and then they are asked to place successive numbers of ducks into a pond (e.g., 1 duck, then 3 ducks, then 4, then 5). It's titrated, so if they get a number wrong, they go up a number. If they get it right, they go down a number. An adult grades their answers by either pressing "next' or "previous" (depending on whether the child got the answer right or wrong). The experiment is meant to end when children either a) fail the 1 trial twice, b) fail any given trial twice, but succeed on the previous trial twice, or c) succeed on the last trial twice.

Sorry, I meant to say - if they get a number wrong, they go down a number. If they get it right, they go up a number*

I see now you sent the script. Thank you SO much!! Works great
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search