Millisecond Forums

use of values for responsekey and position of stimuli

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

By juju - 3/19/2019

Hi,

I am trying to manipulate, at the level of the block, the position of background stimuli and define correct response depending on the condition in which the subject is.
But I am stuck because it seems as if the values cannot be set at the beginning of the experiment.
I tried two solutions without success (attached - I shorten the experiment to focus on the problem).
Could someone tell me what I am doing wrong?
By Dave - 3/19/2019

juju - Wednesday, March 20, 2019
Hi,

I am trying to manipulate, at the level of the block, the position of background stimuli and define correct response depending on the condition in which the subject is.
But I am stuck because it seems as if the values cannot be set at the beginning of the experiment.
I tried two solutions without success (attached - I shorten the experiment to focus on the problem).
Could someone tell me what I am doing wrong?

The <variables> element is the wrong syntax construct to use. To set values at the start of an <expt>, use /onexptbegin attributes like so:

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (1 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (2 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (3 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (4 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

By juju - 3/19/2019

Dave - Wednesday, March 20, 2019
juju - Wednesday, March 20, 2019
Hi,

I am trying to manipulate, at the level of the block, the position of background stimuli and define correct response depending on the condition in which the subject is.
But I am stuck because it seems as if the values cannot be set at the beginning of the experiment.
I tried two solutions without success (attached - I shorten the experiment to focus on the problem).
Could someone tell me what I am doing wrong?

The <variables> element is the wrong syntax construct to use. To set values at the start of an <expt>, use /onexptbegin attributes like so:

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (1 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (2 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (3 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (4 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>


ok thanks - I tried before but it did not work - hope this time it will.


By juju - 3/19/2019

Dave - Wednesday, March 20, 2019
juju - Wednesday, March 20, 2019
Hi,

I am trying to manipulate, at the level of the block, the position of background stimuli and define correct response depending on the condition in which the subject is.
But I am stuck because it seems as if the values cannot be set at the beginning of the experiment.
I tried two solutions without success (attached - I shorten the experiment to focus on the problem).
Could someone tell me what I am doing wrong?

The <variables> element is the wrong syntax construct to use. To set values at the start of an <expt>, use /onexptbegin attributes like so:

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (1 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (2 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (3 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (4 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>


ok thanks - I tried before but it did not work - hope this time it will.


juju - Wednesday, March 20, 2019
Dave - Wednesday, March 20, 2019
juju - Wednesday, March 20, 2019
Hi,

I am trying to manipulate, at the level of the block, the position of background stimuli and define correct response depending on the condition in which the subject is.
But I am stuck because it seems as if the values cannot be set at the beginning of the experiment.
I tried two solutions without success (attached - I shorten the experiment to focus on the problem).
Could someone tell me what I am doing wrong?

The <variables> element is the wrong syntax construct to use. To set values at the start of an <expt>, use /onexptbegin attributes like so:

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (1 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (2 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (3 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (4 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>


ok thanks - I tried before but it did not work - hope this time it will.



Maybe there is some subtle thing I did not get but it still does not work -
I used
<expt>
/onexptbegin = [values.cond=1]
/subjects = (1 of 4)
<expt>

and then

<block prepare>
/trials = [1=setvalue]
/onblockend = [if (values.cond==1) values.keyiat =1;values.keyfamsr=1;values.order=1;values.pair=1;values.pairfamsr=1]
/onblockend = [if (values.cond==2) values.keyiat =2;values.keyfamsr=2;values.order=2;values.pair=2;values.pairfamsr=2]
</block>

and

<block familiar1>
/ bgstim = (instr_F, instr_J, TARG1_l, TARG2_l)
/ trials = [1= inst_induc1; 2-21=random(SAT_TARG1, SAT_TARG2)]
/onblockbegin = [if (values.keyfamsr == 1) text.TARG1_l.hposition = "20%";text.TARG2_l.hposition = "80%"]
/onblockbegin = [if (values.keyfamsr == 1) values.srsidetarg1 = 2; values.srsidetarg2 = 1]
/onblockbegin = [if (values.keyfamsr == 2) text.TARG1_l.hposition = "80%";text.TARG2_l.hposition = "20%"]
/onblockbegin = [if (values.keyfamsr == 2) values.srsidetarg1 = 1; values.srsidetarg2 = 2]
/onblockbegin = [values.block = 1]
/onblockbegin = [values.numitem = 10]
/onblockbegin = [if(values.blockf == 1)text.compito1.textcolor=white]
/onblockbegin = [if(values.blockf == 1)text.compito2.textcolor=white]
/onblockbegin = [if(values.blockf == 1)text.compito3.textcolor=white]
/errormessage = true(error,200)
/onblockend = [values.block = 0]
/onblockend = [values.blockf = values.blockf + 1]
/onblockend = [if(values.order == 1)values.pairfamsr==2]
/onblockend = [if(values.order == 2)values.pairfamsr==1]
</block>

but whatever the number of cond (1 or 2) does not change the position of the background stimulus

Thanks in advance

By Dave - 3/20/2019

juju - Wednesday, March 20, 2019
Dave - Wednesday, March 20, 2019
juju - Wednesday, March 20, 2019
Hi,

I am trying to manipulate, at the level of the block, the position of background stimuli and define correct response depending on the condition in which the subject is.
But I am stuck because it seems as if the values cannot be set at the beginning of the experiment.
I tried two solutions without success (attached - I shorten the experiment to focus on the problem).
Could someone tell me what I am doing wrong?

The <variables> element is the wrong syntax construct to use. To set values at the start of an <expt>, use /onexptbegin attributes like so:

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (1 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (2 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (3 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (4 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>


ok thanks - I tried before but it did not work - hope this time it will.


juju - Wednesday, March 20, 2019
Dave - Wednesday, March 20, 2019
juju - Wednesday, March 20, 2019
Hi,

I am trying to manipulate, at the level of the block, the position of background stimuli and define correct response depending on the condition in which the subject is.
But I am stuck because it seems as if the values cannot be set at the beginning of the experiment.
I tried two solutions without success (attached - I shorten the experiment to focus on the problem).
Could someone tell me what I am doing wrong?

The <variables> element is the wrong syntax construct to use. To set values at the start of an <expt>, use /onexptbegin attributes like so:

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (1 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (2 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (3 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (4 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>


ok thanks - I tried before but it did not work - hope this time it will.



Maybe there is some subtle thing I did not get but it still does not work -
I used
<expt>
/onexptbegin = [values.cond=1]
/subjects = (1 of 4)
<expt>

and then

<block prepare>
/trials = [1=setvalue]
/onblockend = [if (values.cond==1) values.keyiat =1;values.keyfamsr=1;values.order=1;values.pair=1;values.pairfamsr=1]
/onblockend = [if (values.cond==2) values.keyiat =2;values.keyfamsr=2;values.order=2;values.pair=2;values.pairfamsr=2]
</block>

and

<block familiar1>
/ bgstim = (instr_F, instr_J, TARG1_l, TARG2_l)
/ trials = [1= inst_induc1; 2-21=random(SAT_TARG1, SAT_TARG2)]
/onblockbegin = [if (values.keyfamsr == 1) text.TARG1_l.hposition = "20%";text.TARG2_l.hposition = "80%"]
/onblockbegin = [if (values.keyfamsr == 1) values.srsidetarg1 = 2; values.srsidetarg2 = 1]
/onblockbegin = [if (values.keyfamsr == 2) text.TARG1_l.hposition = "80%";text.TARG2_l.hposition = "20%"]
/onblockbegin = [if (values.keyfamsr == 2) values.srsidetarg1 = 1; values.srsidetarg2 = 2]
/onblockbegin = [values.block = 1]
/onblockbegin = [values.numitem = 10]
/onblockbegin = [if(values.blockf == 1)text.compito1.textcolor=white]
/onblockbegin = [if(values.blockf == 1)text.compito2.textcolor=white]
/onblockbegin = [if(values.blockf == 1)text.compito3.textcolor=white]
/errormessage = true(error,200)
/onblockend = [values.block = 0]
/onblockend = [values.blockf = values.blockf + 1]
/onblockend = [if(values.order == 1)values.pairfamsr==2]
/onblockend = [if(values.order == 2)values.pairfamsr==1]
</block>

but whatever the number of cond (1 or 2) does not change the position of the background stimulus

Thanks in advance


There are some syntax issues with your code (none of which have anything to do with the values set /onexptbegin, by the way). First, whenever you wish to execute multiple actions under a single condition, you ought to use curly braces. I.e.

<block prepare>
/trials = [1=setvalue]
/onblockend = [if (values.cond==1) values.keyiat =1; values.keyfamsr=1;values.order=1;values.pair=1;values.pairfamsr=1]
/onblockend = [if (values.cond==2) values.keyiat =2; values.keyfamsr=2;values.order=2;values.pair=2;values.pairfamsr=2]
</block>

is wrong. Only the the two bolded statements are conditional, the rest is unconditional. To work properly, this ought to read:

<block prepare>
/trials = [1=setvalue]
/onblockend = [if (values.cond==1) {values.keyiat =1;values.keyfamsr=1;values.order=1;values.pair=1;values.pairfamsr=1}]
/onblockend = [if (values.cond==2) {values.keyiat =2;values.keyfamsr=2;values.order=2;values.pair=2;values.pairfamsr=2}]
</block>

Virtually all /onblockbegin statements throughout the script suffer from that mistake. I've fixed that in the attached script.
By juju - 3/20/2019

Dave - Wednesday, March 20, 2019
juju - Wednesday, March 20, 2019
Dave - Wednesday, March 20, 2019
juju - Wednesday, March 20, 2019
Hi,

I am trying to manipulate, at the level of the block, the position of background stimuli and define correct response depending on the condition in which the subject is.
But I am stuck because it seems as if the values cannot be set at the beginning of the experiment.
I tried two solutions without success (attached - I shorten the experiment to focus on the problem).
Could someone tell me what I am doing wrong?

The <variables> element is the wrong syntax construct to use. To set values at the start of an <expt>, use /onexptbegin attributes like so:

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (1 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (2 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (3 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (4 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>


ok thanks - I tried before but it did not work - hope this time it will.


juju - Wednesday, March 20, 2019
Dave - Wednesday, March 20, 2019
juju - Wednesday, March 20, 2019
Hi,

I am trying to manipulate, at the level of the block, the position of background stimuli and define correct response depending on the condition in which the subject is.
But I am stuck because it seems as if the values cannot be set at the beginning of the experiment.
I tried two solutions without success (attached - I shorten the experiment to focus on the problem).
Could someone tell me what I am doing wrong?

The <variables> element is the wrong syntax construct to use. To set values at the start of an <expt>, use /onexptbegin attributes like so:

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (1 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 1;]
/subjects = (2 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (3 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>

<expt>
/ onexptbegin = [values.cond = 2;]
/subjects = (4 of 4)
/ blocks = [1=prepare;2=familiar1; 3=familiar2]
</expt>


ok thanks - I tried before but it did not work - hope this time it will.



Maybe there is some subtle thing I did not get but it still does not work -
I used
<expt>
/onexptbegin = [values.cond=1]
/subjects = (1 of 4)
<expt>

and then

<block prepare>
/trials = [1=setvalue]
/onblockend = [if (values.cond==1) values.keyiat =1;values.keyfamsr=1;values.order=1;values.pair=1;values.pairfamsr=1]
/onblockend = [if (values.cond==2) values.keyiat =2;values.keyfamsr=2;values.order=2;values.pair=2;values.pairfamsr=2]
</block>

and

<block familiar1>
/ bgstim = (instr_F, instr_J, TARG1_l, TARG2_l)
/ trials = [1= inst_induc1; 2-21=random(SAT_TARG1, SAT_TARG2)]
/onblockbegin = [if (values.keyfamsr == 1) text.TARG1_l.hposition = "20%";text.TARG2_l.hposition = "80%"]
/onblockbegin = [if (values.keyfamsr == 1) values.srsidetarg1 = 2; values.srsidetarg2 = 1]
/onblockbegin = [if (values.keyfamsr == 2) text.TARG1_l.hposition = "80%";text.TARG2_l.hposition = "20%"]
/onblockbegin = [if (values.keyfamsr == 2) values.srsidetarg1 = 1; values.srsidetarg2 = 2]
/onblockbegin = [values.block = 1]
/onblockbegin = [values.numitem = 10]
/onblockbegin = [if(values.blockf == 1)text.compito1.textcolor=white]
/onblockbegin = [if(values.blockf == 1)text.compito2.textcolor=white]
/onblockbegin = [if(values.blockf == 1)text.compito3.textcolor=white]
/errormessage = true(error,200)
/onblockend = [values.block = 0]
/onblockend = [values.blockf = values.blockf + 1]
/onblockend = [if(values.order == 1)values.pairfamsr==2]
/onblockend = [if(values.order == 2)values.pairfamsr==1]
</block>

but whatever the number of cond (1 or 2) does not change the position of the background stimulus

Thanks in advance


There are some syntax issues with your code (none of which have anything to do with the values set /onexptbegin, by the way). First, whenever you wish to execute multiple actions under a single condition, you ought to use curly braces. I.e.

<block prepare>
/trials = [1=setvalue]
/onblockend = [if (values.cond==1) values.keyiat =1; values.keyfamsr=1;values.order=1;values.pair=1;values.pairfamsr=1]
/onblockend = [if (values.cond==2) values.keyiat =2; values.keyfamsr=2;values.order=2;values.pair=2;values.pairfamsr=2]
</block>

is wrong. Only the the two bolded statements are conditional, the rest is unconditional. To work properly, this ought to read:

<block prepare>
/trials = [1=setvalue]
/onblockend = [if (values.cond==1) {values.keyiat =1;values.keyfamsr=1;values.order=1;values.pair=1;values.pairfamsr=1}]
/onblockend = [if (values.cond==2) {values.keyiat =2;values.keyfamsr=2;values.order=2;values.pair=2;values.pairfamsr=2}]
</block>

Virtually all /onblockbegin statements throughout the script suffer from that mistake. I've fixed that in the attached script.

Thank you very much for your help!