How to link video’s between trials depending on choices?


Author
Message
Amarins
Amarins
Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)
Group: Forum Members
Posts: 11, Visits: 77
Hi all,

For a simple two-options choice task (two types of products are presented left and right on the screen), I have feedback pictures/animations (earth_ani_mov) that change depending on the choices of participants. There are 5 choice-trials in a block, and the feedback can be positive or negative. I have 19 animations (called ‘etmov’), and start with the middle/baseline animation (etmov10) at trial 1. If participants choose the ‘sustainable option’, I want that etmov10 changes to etmov11 at the outcome at the first trial, and then I want trial 2 to start with etmov12. If the participant chooses the ‘sustainable option’ at trial 2 again, I want that etmov12 changes to etmov13 at the end of the block, and that trial 3 starts with etmov14. And so on. (where the feedback becomes negative when participants choose the 'unsustainable option', then, at trial 3, etmov14 would via etmov13 back to etmov12). So, for example, when participants choose ‘unsustainable’ at trial 1, the animations decrease from etmov10 at trial1, to etmov1 ultimately at the end of trial 5.

How can I make sure, that after each trial, the next animation in line is presented?
When I run my script now, sometimes one animation is skipped in line and I cannot figure out why.
Can anyone help me?
Thank you!

Below you find my script:

<expt T1_feedback>
/ blocks = [1-8 = noreplace(block_fb_1s10, block_fb_2s10)]
/ subjects = (2 of 2)
</expt>

<block block_fb_1s10>
/ trials = [1 = noreplace(sus_left_fb_1s10_choice, sus_right_fb_1s10_choice); 2 = fb_1s10_outcome;
3 = noreplace(sus_left_fb_1s10_choice, sus_right_fb_1s10_choice); 4 = fb_1s10_outcome;
5 = noreplace(sus_left_fb_1s10_choice, sus_right_fb_1s10_choice); 6 = fb_1s10_outcome;
7 = noreplace(sus_left_fb_1s10_choice, sus_right_fb_1s10_choice); 8 = fb_1s10_outcome;
9 = noreplace(sus_left_fb_1s10_choice, sus_right_fb_1s10_choice); 10 = fb_1s10_outcome]
/ onblockend = [values.earth = 10]
</block>

<block block_fb_2s10>
/ trials = [1 = noreplace(sus_left_fb_2s10_choice, sus_right_fb_2s10_choice); 2 = fb_2s10_outcome;
3 = noreplace(sus_left_fb_2s10_choice, sus_right_fb_2s10_choice); 4 = fb_2s10_outcome;
5 = noreplace(sus_left_fb_2s10_choice, sus_right_fb_2s10_choice); 6 = fb_2s10_outcome;
7 = noreplace(sus_left_fb_2s10_choice, sus_right_fb_2s10_choice); 8 = fb_2s10_outcome;
9 = noreplace(sus_left_fb_2s10_choice, sus_right_fb_2s10_choice); 10 = fb_2s10_outcome]
/ onblockend = [values.earth = 10]
</block>

<trial sus_left_fb_1s10_choice>
/ ontrialbegin = [if (trial.sus_left_fb_1s10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susleft_10, product_unsright_10, earth_ani_mov;
2000 = timer, reminder]
/ correctresponse = ("a")
/ validresponse = ("a", "l")
/ ontrialend = [
If (trial.sus_left_fb_1s10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_1s10_choice.response == 38) values.earth -= 1;
]
/ responsetrial = (noresponse, sus_left_fb_1s10_choice)
</trial>

<trial sus_right_fb_1s10_choice>
/ ontrialbegin = [if (trial.sus_right_fb_1s10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susright_10, product_unsleft_10, earth_ani_mov;
2000 = timer, reminder]
/ correctresponse = ("l")
/ validresponse = ("l", "a")
/ ontrialend = [
If (trial.sus_right_fb_1s10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_1s10_choice.response == 30) values.earth -= 1;
]
/ responsetrial = (noresponse, sus_right_fb_1s10_choice)
</trial>

<trial fb_1s10_outcome>
/ stimulustimes = [1 = earth_ani_mov, Mask, Mask1, Mask2]
/ ontrialend = [
If (trial.sus_left_fb_1s10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_1s10_choice.response == 38) values.earth -= 1;
If (trial.sus_right_fb_1s10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_1s10_choice.response == 30) values.earth -= 1;
]
</trial>

<trial sus_left_fb_2s10_choice>
/ ontrialbegin = [if (trial.sus_left_fb_2s10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susleft_10, product_unsright_10, earth_ani_mov;
2000 = timer, reminder]
/ correctresponse = ("a")
/ validresponse = ("a", "l")
/ ontrialend = [
If (trial.sus_left_fb_2s10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_2s10_choice.response == 38) values.earth -= 1;
]
/ responsetrial = (noresponse, sus_left_fb_2s10_choice)
</trial>

<trial sus_right_fb_2s10_choice>
/ ontrialbegin = [if (trial.sus_right_fb_2s10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susright_10, product_unsleft_10, earth_ani_mov;
2000 = timer, reminder]
/ correctresponse = ("l")
/ validresponse = ("l", "a")
/ ontrialend = [
If (trial.sus_right_fb_2s10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_2s10_choice.response == 30) values.earth -= 1;
]
/ responsetrial = (noresponse, sus_right_fb_2s10_choice)
</trial>

<trial fb_2s10_outcome>
/ stimulustimes = [1 = earth_ani_mov]
/ ontrialend = [
If (trial.sus_left_fb_2s10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_2s10_choice.response == 38) values.earth -= 1;
If (trial.sus_right_fb_2s10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_2s10_choice.response == 30) values.earth -= 1;
]
</trial>

<picture product_susleft_10>
/ items = sustainable_10
/ select = values.itemnumber
</picture>
<picture product_unsright_10>
/ items = unsustainable_10
/ select = values.itemnumber
/ select = current(product_susleft_10)
</picture>

<picture product_susright_10>
/ items = sustainable_10
/ select = values.itemnumber
</picture>
<picture product_unsleft_10>
/ items = unsustainable_10
/ select = values.itemnumber
/ select = current(product_susright_10)
</picture>

<list allitems10>
/ poolsize = 25
/ resetinterval = 0
</list>

<item sustainable_10>
/1 = "1s2.jpg"
/2 = "2s2.jpg"
/3 = "7s2.jpg"
t/m 25

<item unsustainable_10>
/1 = "1u2.jpg"
/2 = "2u2.jpg"
/3 = "7u2.jpg"
t/m 25

<values>
/ earth = 10
</values>

<video earth_ani_mov>
/ items = earth_video
/ loop = true
/ select = values.earth
</video>

<list earth>
/ items = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
/ replace = true
</list>

<item earth_video>
/1 = "etmov1.mp4"
/2 = "etmov2.mp4"
/3 = "etmov3.mp4"
/4 = "etmov4.mp4"
/5 = "etmov5.mp4"
/6 = "etmov6.mp4"
/7 = "etmov7.mp4"
/8 = "etmov8.mp4"
/9 = "etmov9.mp4"
/10 = "etmov10.mp4"
/11 = "etmov11.mp4"
/12 = "etmov12.mp4"
/13 = "etmov13.mp4"
/14 = "etmov14.mp4"
/15 = "etmov15.mp4"
/16 = "etmov16.mp4"
/17 = "etmov17.mp4"
/18 = "etmov18.mp4"
/19 = "etmov19.mp4"
</item>


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: 13K, Visits: 104K
Amarins - 3/9/2020
Hi all,

For a simple two-options choice task (two types of products are presented left and right on the screen), I have feedback pictures/animations (earth_ani_mov) that change depending on the choices of participants. There are 5 choice-trials in a block, and the feedback can be positive or negative. I have 19 animations (called ‘etmov’), and start with the middle/baseline animation (etmov10) at trial 1. If participants choose the ‘sustainable option’, I want that etmov10 changes to etmov11 at the outcome at the first trial, and then I want trial 2 to start with etmov12. If the participant chooses the ‘sustainable option’ at trial 2 again, I want that etmov12 changes to etmov13 at the end of the block, and that trial 3 starts with etmov14. And so on. (where the feedback becomes negative when participants choose the 'unsustainable option', then, at trial 3, etmov14 would via etmov13 back to etmov12). So, for example, when participants choose ‘unsustainable’ at trial 1, the animations decrease from etmov10 at trial1, to etmov1 ultimately at the end of trial 5.

How can I make sure, that after each trial, the next animation in line is presented?
When I run my script now, sometimes one animation is skipped in line and I cannot figure out why.
Can anyone help me?
Thank you!

Below you find my script:

<expt T1_feedback>
/ blocks = [1-8 = noreplace(block_fb_1s10, block_fb_2s10)]
/ subjects = (2 of 2)
</expt>

<block block_fb_1s10>
/ trials = [1 = noreplace(sus_left_fb_1s10_choice, sus_right_fb_1s10_choice); 2 = fb_1s10_outcome;
3 = noreplace(sus_left_fb_1s10_choice, sus_right_fb_1s10_choice); 4 = fb_1s10_outcome;
5 = noreplace(sus_left_fb_1s10_choice, sus_right_fb_1s10_choice); 6 = fb_1s10_outcome;
7 = noreplace(sus_left_fb_1s10_choice, sus_right_fb_1s10_choice); 8 = fb_1s10_outcome;
9 = noreplace(sus_left_fb_1s10_choice, sus_right_fb_1s10_choice); 10 = fb_1s10_outcome]
/ onblockend = [values.earth = 10]
</block>

<block block_fb_2s10>
/ trials = [1 = noreplace(sus_left_fb_2s10_choice, sus_right_fb_2s10_choice); 2 = fb_2s10_outcome;
3 = noreplace(sus_left_fb_2s10_choice, sus_right_fb_2s10_choice); 4 = fb_2s10_outcome;
5 = noreplace(sus_left_fb_2s10_choice, sus_right_fb_2s10_choice); 6 = fb_2s10_outcome;
7 = noreplace(sus_left_fb_2s10_choice, sus_right_fb_2s10_choice); 8 = fb_2s10_outcome;
9 = noreplace(sus_left_fb_2s10_choice, sus_right_fb_2s10_choice); 10 = fb_2s10_outcome]
/ onblockend = [values.earth = 10]
</block>

<trial sus_left_fb_1s10_choice>
/ ontrialbegin = [if (trial.sus_left_fb_1s10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susleft_10, product_unsright_10, earth_ani_mov;
2000 = timer, reminder]
/ correctresponse = ("a")
/ validresponse = ("a", "l")
/ ontrialend = [
If (trial.sus_left_fb_1s10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_1s10_choice.response == 38) values.earth -= 1;
]
/ responsetrial = (noresponse, sus_left_fb_1s10_choice)
</trial>

<trial sus_right_fb_1s10_choice>
/ ontrialbegin = [if (trial.sus_right_fb_1s10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susright_10, product_unsleft_10, earth_ani_mov;
2000 = timer, reminder]
/ correctresponse = ("l")
/ validresponse = ("l", "a")
/ ontrialend = [
If (trial.sus_right_fb_1s10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_1s10_choice.response == 30) values.earth -= 1;
]
/ responsetrial = (noresponse, sus_right_fb_1s10_choice)
</trial>

<trial fb_1s10_outcome>
/ stimulustimes = [1 = earth_ani_mov, Mask, Mask1, Mask2]
/ ontrialend = [
If (trial.sus_left_fb_1s10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_1s10_choice.response == 38) values.earth -= 1;
If (trial.sus_right_fb_1s10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_1s10_choice.response == 30) values.earth -= 1;
]
</trial>

<trial sus_left_fb_2s10_choice>
/ ontrialbegin = [if (trial.sus_left_fb_2s10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susleft_10, product_unsright_10, earth_ani_mov;
2000 = timer, reminder]
/ correctresponse = ("a")
/ validresponse = ("a", "l")
/ ontrialend = [
If (trial.sus_left_fb_2s10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_2s10_choice.response == 38) values.earth -= 1;
]
/ responsetrial = (noresponse, sus_left_fb_2s10_choice)
</trial>

<trial sus_right_fb_2s10_choice>
/ ontrialbegin = [if (trial.sus_right_fb_2s10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susright_10, product_unsleft_10, earth_ani_mov;
2000 = timer, reminder]
/ correctresponse = ("l")
/ validresponse = ("l", "a")
/ ontrialend = [
If (trial.sus_right_fb_2s10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_2s10_choice.response == 30) values.earth -= 1;
]
/ responsetrial = (noresponse, sus_right_fb_2s10_choice)
</trial>

<trial fb_2s10_outcome>
/ stimulustimes = [1 = earth_ani_mov]
/ ontrialend = [
If (trial.sus_left_fb_2s10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_2s10_choice.response == 38) values.earth -= 1;
If (trial.sus_right_fb_2s10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_2s10_choice.response == 30) values.earth -= 1;
]
</trial>

<picture product_susleft_10>
/ items = sustainable_10
/ select = values.itemnumber
</picture>
<picture product_unsright_10>
/ items = unsustainable_10
/ select = values.itemnumber
/ select = current(product_susleft_10)
</picture>

<picture product_susright_10>
/ items = sustainable_10
/ select = values.itemnumber
</picture>
<picture product_unsleft_10>
/ items = unsustainable_10
/ select = values.itemnumber
/ select = current(product_susright_10)
</picture>

<list allitems10>
/ poolsize = 25
/ resetinterval = 0
</list>

<item sustainable_10>
/1 = "1s2.jpg"
/2 = "2s2.jpg"
/3 = "7s2.jpg"
t/m 25

<item unsustainable_10>
/1 = "1u2.jpg"
/2 = "2u2.jpg"
/3 = "7u2.jpg"
t/m 25

<values>
/ earth = 10
</values>

<video earth_ani_mov>
/ items = earth_video
/ loop = true
/ select = values.earth
</video>

<list earth>
/ items = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
/ replace = true
</list>

<item earth_video>
/1 = "etmov1.mp4"
/2 = "etmov2.mp4"
/3 = "etmov3.mp4"
/4 = "etmov4.mp4"
/5 = "etmov5.mp4"
/6 = "etmov6.mp4"
/7 = "etmov7.mp4"
/8 = "etmov8.mp4"
/9 = "etmov9.mp4"
/10 = "etmov10.mp4"
/11 = "etmov11.mp4"
/12 = "etmov12.mp4"
/13 = "etmov13.mp4"
/14 = "etmov14.mp4"
/15 = "etmov15.mp4"
/16 = "etmov16.mp4"
/17 = "etmov17.mp4"
/18 = "etmov18.mp4"
/19 = "etmov19.mp4"
</item>


Would it be possible to please provide code that's actually runnable? I.e. please make sure all elements referenced in the code are actually present, and please provide any and all files the code requires. Thank you.
Amarins
Amarins
Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)
Group: Forum Members
Posts: 11, Visits: 77
Hi Dave,

I am so sorry, of course! In the attachment you can find my Inquisit-file and all stimuli. Thanks in advance!
Attachments
Climateagency_study2.iqx (247 views, 16.00 KB)
Stimuli_part1.zip (267 views, 1.00 MB)
Stimuli_part2.zip (275 views, 2.00 MB)
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: 13K, Visits: 104K
Amarins - 3/10/2020
Hi Dave,

I am so sorry, of course! In the attachment you can find my Inquisit-file and all stimuli. Thanks in advance!

Thank you. Here's what I don't understand. You increase or decrease values.earth (which is responsible for selecting the animation item number) depending on response in your choice trials:

<trial sus_left_fb_10_choice>
/ ontrialbegin = [if (trial.sus_left_fb_10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susleft_10, product_unsright_10, earth_ani_mov;
1000 = co2_susleft_low, co2_unsright_high;
2000 = timer, reminder]
/ correctresponse = ("a")
/ validresponse = ("a", "l")
/ ontrialend = [
If (trial.sus_left_fb_10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_10_choice.response == 38) values.earth -= 1;

]
/ timeout = 15000
/ responsetrial = (noresponse, sus_left_fb_10_choice)
</trial>

<trial sus_right_fb_10_choice>
/ ontrialbegin = [if (trial.sus_right_fb_10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susright_10, product_unsleft_10, earth_ani_mov;
1000 = co2_susright_low, co2_unsleft_high;
2000 = timer, reminder]
/ correctresponse = ("l")
/ validresponse = ("l", "a")
/ ontrialend = [
If (trial.sus_right_fb_10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_10_choice.response == 30) values.earth -= 1;

]
/ timeout = 15000
/ responsetrial = (noresponse, sus_right_fb_10_choice)
</trial>

So far, so good. But then, in the outcome trial that follows every choice trial, you do so again:

<trial fb_10_outcome>
/ stimulustimes = [1 = earth_ani_mov, Mask, Mask1, Mask2]
/ ontrialend = [
If (trial.sus_left_fb_10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_10_choice.response == 38) values.earth -= 1;
If (trial.sus_right_fb_10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_10_choice.response == 30) values.earth -= 1;

]
/ timeout = 2000
</trial>

Why?

In addition, the /ontrialend logic in the outcome trial is problematic, because depending on what exactly happened before, you'll in- or decrease values.earth by 2 (or not at all). Here's why:

- Suppose the 1st choice trial in the block is sus_left_fb_10_choice, and the response is 30. Then there's a 1st instance of the outcome trial.
- Suppose the 2nd choice trial in the block is sus_right_fb_10_choice, and the response is 38. Now things get problematic in the outcome trial:

<trial fb_10_outcome>
/ stimulustimes = [1 = earth_ani_mov, Mask, Mask1, Mask2]
/ ontrialend = [
If (trial.sus_left_fb_10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_10_choice.response == 38) values.earth -= 1;
If (trial.sus_right_fb_10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_10_choice.response == 30) values.earth -= 1;
]
/ timeout = 2000
</trial>

Both bolded conditions are true now: trial.sus_left_fb_10_choice's response is still 30 -- that was the 1st choice trial in the block. AND trial.sus_right_fb_10_choice's response is 38, that was the 2nd choice trial in the block. The consequence is that values.earth will be increased by 2.

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: 13K, Visits: 104K
Dave - 3/10/2020
Amarins - 3/10/2020
Hi Dave,

I am so sorry, of course! In the attachment you can find my Inquisit-file and all stimuli. Thanks in advance!

Thank you. Here's what I don't understand. You increase or decrease values.earth (which is responsible for selecting the animation item number) depending on response in your choice trials:

<trial sus_left_fb_10_choice>
/ ontrialbegin = [if (trial.sus_left_fb_10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susleft_10, product_unsright_10, earth_ani_mov;
1000 = co2_susleft_low, co2_unsright_high;
2000 = timer, reminder]
/ correctresponse = ("a")
/ validresponse = ("a", "l")
/ ontrialend = [
If (trial.sus_left_fb_10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_10_choice.response == 38) values.earth -= 1;

]
/ timeout = 15000
/ responsetrial = (noresponse, sus_left_fb_10_choice)
</trial>

<trial sus_right_fb_10_choice>
/ ontrialbegin = [if (trial.sus_right_fb_10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susright_10, product_unsleft_10, earth_ani_mov;
1000 = co2_susright_low, co2_unsleft_high;
2000 = timer, reminder]
/ correctresponse = ("l")
/ validresponse = ("l", "a")
/ ontrialend = [
If (trial.sus_right_fb_10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_10_choice.response == 30) values.earth -= 1;

]
/ timeout = 15000
/ responsetrial = (noresponse, sus_right_fb_10_choice)
</trial>

So far, so good. But then, in the outcome trial that follows every choice trial, you do so again:

<trial fb_10_outcome>
/ stimulustimes = [1 = earth_ani_mov, Mask, Mask1, Mask2]
/ ontrialend = [
If (trial.sus_left_fb_10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_10_choice.response == 38) values.earth -= 1;
If (trial.sus_right_fb_10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_10_choice.response == 30) values.earth -= 1;

]
/ timeout = 2000
</trial>

Why?

In addition, the /ontrialend logic in the outcome trial is problematic, because depending on what exactly happened before, you'll in- or decrease values.earth by 2 (or not at all). Here's why:

- Suppose the 1st choice trial in the block is sus_left_fb_10_choice, and the response is 30. Then there's a 1st instance of the outcome trial.
- Suppose the 2nd choice trial in the block is sus_right_fb_10_choice, and the response is 38. Now things get problematic in the outcome trial:

<trial fb_10_outcome>
/ stimulustimes = [1 = earth_ani_mov, Mask, Mask1, Mask2]
/ ontrialend = [
If (trial.sus_left_fb_10_choice.response == 30) values.earth += 1;
If (trial.sus_left_fb_10_choice.response == 38) values.earth -= 1;
If (trial.sus_right_fb_10_choice.response == 38) values.earth += 1;
If (trial.sus_right_fb_10_choice.response == 30) values.earth -= 1;
]
/ timeout = 2000
</trial>

Both bolded conditions are true now: trial.sus_left_fb_10_choice's response is still 30 -- that was the 1st choice trial in the block. AND trial.sus_right_fb_10_choice's response is 38, that was the 2nd choice trial in the block. The consequence is that values.earth will be increased by 2.

To avoid the double-counting detailed above, I'd recommed simply handling everything related to increment or decrementing values.earth in the choice trials. I.e. define an additional value

<values>
/ earth = 10
/ nextearth = 0
</values>

Keep updating values.earth as usual, but in parallel set values.nextearth to the next value you need, i.e. one higher or lower than the current values.earth:

<trial sus_left_fb_10_choice>
/ ontrialbegin = [if (trial.sus_left_fb_10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susleft_10, product_unsright_10, earth_ani_mov;
1000 = co2_susleft_low, co2_unsright_high;
2000 = timer, reminder]
/ correctresponse = ("a")
/ validresponse = ("a", "l")
/ ontrialend = [
If (trial.sus_left_fb_10_choice.response == 30) {values.earth += 1; values.nextearth = values.earth + 1;};
If (trial.sus_left_fb_10_choice.response == 38) {values.earth -= 1; values.nextearth = values.earth - 1;};

]
/ timeout = 15000
/ responsetrial = (noresponse, sus_left_fb_10_choice)
</trial>

<trial sus_right_fb_10_choice>
/ ontrialbegin = [if (trial.sus_right_fb_10_choice.response != 0) {values.itemnumber = list.allitems10.nextindex;};]
/ stimulustimes = [1 = product_susright_10, product_unsleft_10, earth_ani_mov;
1000 = co2_susright_low, co2_unsleft_high;
2000 = timer, reminder]
/ correctresponse = ("l")
/ validresponse = ("l", "a")
/ ontrialend = [
If (trial.sus_right_fb_10_choice.response == 38) {values.earth += 1; values.nextearth = values.earth + 1;};
If (trial.sus_right_fb_10_choice.response == 30) {values.earth -= 1; values.nextearth = values.earth - 1;};

]
/ timeout = 15000
/ responsetrial = (noresponse, sus_right_fb_10_choice)
</trial>

Finally, in the outcome trial, just flip in the next value:

<trial fb_10_outcome>
/ stimulustimes = [1 = earth_ani_mov, Mask, Mask1, Mask2]
/ ontrialend = [
    values.earth = values.nextearth;
]
/ timeout = 2000
</trial>



Amarins
Amarins
Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)
Group: Forum Members
Posts: 11, Visits: 77
Hi Dave, thank you so much for your help! 

Not sure why I thought adding the same /ontrialend logic in the outcome trial was a good idea. Your suggestion makes much more sense indeed!

Unfortunately, I still encounter a problem when running your suggestions in my script. I hope you can help me with this as well. 
The first block seems to be okay, but in the next blocks something goes wrong. 

The problem is the following:
When you switch from choosing sustainable options (the "correct" choice that leads to an increase in the values for earth) to unsustainable option (the "incorrect" choice that leads to an decrease in values of earth),
then the sequence of values.earth seems not to be disrupted. It doesn't become negative. It seems that the next earth values only continue in positive direction. How can I make sure that the next value option also goes to the other direction? Does it have something to do with resetting the next.earth values on block level maybe?

Hopefully I was able to explain what I mean...
(I also added my new Inquisit-file)
Attachments
Climateagency_study2(2).iqx (250 views, 16.00 KB)
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: 13K, Visits: 104K
Amarins - 3/10/2020
Hi Dave, thank you so much for your help! 

Not sure why I thought adding the same /ontrialend logic in the outcome trial was a good idea. Your suggestion makes much more sense indeed!

Unfortunately, I still encounter a problem when running your suggestions in my script. I hope you can help me with this as well. 
The first block seems to be okay, but in the next blocks something goes wrong. 

The problem is the following:
When you switch from choosing sustainable options (the "correct" choice that leads to an increase in the values for earth) to unsustainable option (the "incorrect" choice that leads to an decrease in values of earth),
then the sequence of values.earth seems not to be disrupted. It doesn't become negative. It seems that the next earth values only continue in positive direction. How can I make sure that the next value option also goes to the other direction? Does it have something to do with resetting the next.earth values on block level maybe?

Hopefully I was able to explain what I mean...
(I also added my new Inquisit-file)

<trial sus_left_fb_20_choice>
/ ontrialbegin = [if (trial.sus_left_fb_20_choice.response != 0) {values.itemnumber = list.allitems20.nextindex;};]
/ stimulustimes = [1 = product_susleft_20, product_unsright_20, earth_ani_mov;
1000 = co2_susleft_low, co2_unsright_high;
2000 = timer, reminder]
/ correctresponse = ("a")
/ validresponse = ("a", "l")
/ ontrialend = [
If (trial.sus_left_fb_10_choice.response == 30) {values.earth += 1; values.nextearth = values.earth + 1;};
If (trial.sus_left_fb_10_choice.response == 38) {values.earth -= 1; values.nextearth = values.earth - 1;};
]
/ timeout = 15000
/ responsetrial = (noresponse, sus_left_fb_20_choice)
</trial>

<trial sus_right_fb_20_choice>
/ ontrialbegin = [if (trial.sus_right_fb_20_choice.response != 0) {values.itemnumber = list.allitems20.nextindex;};]
/ stimulustimes = [1 = product_susright_20, product_unsleft_20, earth_ani_mov;
1000 = co2_susright_low, co2_unsleft_high;
2000 = timer, reminder]
/ correctresponse = ("l")
/ validresponse = ("l", "a")
/ ontrialend = [
If (trial.sus_right_fb_10_choice.response == 38) {values.earth += 1; values.nextearth = values.earth + 1;};
If (trial.sus_right_fb_10_choice.response == 30) {values.earth -= 1; values.nextearth = values.earth - 1;};
]
/ timeout = 15000
/ responsetrial = (noresponse, sus_right_fb_20_choice)
</trial>

You are referencing the wrong trials in your /ontrialend logic. The above needs to read

<trial sus_left_fb_20_choice>
/ ontrialbegin = [if (trial.sus_left_fb_20_choice.response != 0) {values.itemnumber = list.allitems20.nextindex;};]
/ stimulustimes = [1 = product_susleft_20, product_unsright_20, earth_ani_mov;
1000 = co2_susleft_low, co2_unsright_high;
2000 = timer, reminder]
/ correctresponse = ("a")
/ validresponse = ("a", "l")
/ ontrialend = [
If (trial.sus_left_fb_20_choice.response == 30) {values.earth += 1; values.nextearth = values.earth + 1;};
If (trial.sus_left_fb_20_choice.response == 38) {values.earth -= 1; values.nextearth = values.earth - 1;};
]
/ timeout = 15000
/ responsetrial = (noresponse, sus_left_fb_20_choice)
</trial>

<trial sus_right_fb_20_choice>
/ ontrialbegin = [if (trial.sus_right_fb_20_choice.response != 0) {values.itemnumber = list.allitems20.nextindex;};]
/ stimulustimes = [1 = product_susright_20, product_unsleft_20, earth_ani_mov;
1000 = co2_susright_low, co2_unsleft_high;
2000 = timer, reminder]
/ correctresponse = ("l")
/ validresponse = ("l", "a")
/ ontrialend = [
If (trial.sus_right_fb_20_choice.response == 38) {values.earth += 1; values.nextearth = values.earth + 1;};
If (trial.sus_right_fb_20_choice.response == 30) {values.earth -= 1; values.nextearth = values.earth - 1;};
]
/ timeout = 15000
/ responsetrial = (noresponse, sus_right_fb_20_choice)
</trial>
Amarins
Amarins
Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)Respected Member (421 reputation)
Group: Forum Members
Posts: 11, Visits: 77
Oops, stupid mistake... It has been a long day. Thank you for being so sharp Dave! 
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search