jm560@sussex.ac.uk
|
|
Group: Forum Members
Posts: 25,
Visits: 208
|
+x+x+x+x+x+x Hi,
I am trying to make a script that has a lot of counterbalancing, because ofthis I need the locations of the various distractor stimuli to be dependent onthe trial type. I've been trying to do this with conditional statements butcan't get it to work. I've copied the relevant bits of script below (hopefully that's enough - I haven't changed the rest of the script yet so thought it would be more confusing to attach the whole thing). I'm trying to test it just on the h position of filler 1 but I would want to change v position too later. Any help/ suggestions of how else I could do this would be appreciated!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
<values> /hp1 = 50% /hp2 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2)- (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px *(display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </values> <trial lowX1> / ontrialbegin =[trial.lowX1.insertstimulustime(list.distractorXl1.nextvalue,500);] / ontrialbegin =[values.distractor = list.distractorXl1.currentvalue;] / ontrialbegin = [ if(contains(list.distractorXl1.currentvalue, "X")) values.category ="congruent"; else if(contains(list.distractorXl1.currentvalue, "N")) values.category ="incongruent"; ] / ontrialend =[trial.lowX1.resetstimulusframes(); ] / stimulustimes = [1=fixation;500=sequence (fixationcover, XLD1, filler1, filler2, filler3, filler4,filler5); 600=sequence (eraser1, eraser2, eraser3, eraser4, eraser5, eraser6)] / validresponse = ("J","I") / correctresponse =("J") / response = timeout(2000) / beginresponsetime = 500 </trial>
Thanks!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
This isn't valid syntax, there is no such thing as "trialcode", you're using the wrong operator etc. You should simply do something like this:
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = values.fillerhpos / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
with
<values> / fillerhpos = 0% / hp1 = 50% ... </values>
and then set the value in the respective <trial> elements, i.e.
<trial lowX1> / ontrialbegin = [values.fillerhpos = values.hp2] ... </trial>
<trial lowX2> / ontrialbegin = [values.fillerhpos = values.hp3] ... </trial>
and so forth. Ahh this makes much more sense! Thank you! Hi again, I've being trying to implement this and it works perfectly when using actual numbers but not when generating numbers using my calibration for absolute sizes. (the one provided in this post - https://www.millisecond.com/forums/Topic14608.aspx) I.e if hp1= 50% then that is fine and works but if hp1 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm then it stops working. I've used that expression throughout the experiment and it works fine. Perhaps inquisit can't load this quickly enough on a trial by trial basis? Is there a way around this? I get the following error messages when I try and run the script Expression 'values.linelength_px' is invalid. Expression contains an unknown element or property name. Error evaluating 'values.linelength_px/85.6': Expression contains an unknown element or property name. Error evaluating 'values.linelength_px/85.6': Unknown error. the value.linelength is part of the calibration script - which is used to calculate the expressions.ratio_pxpermm line in my script which seems to be the problem. Perhaps if my script found the value of expressions.ratio_pxpermm at the beginning of the experiment and used that value it would help? - i'm not sure how to do this... I've attached my currently non working script (which does work when you change the expression to actual numbers) here too Thanks, Jenny <values positions> /hp1 = 50% /hp2 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px * (display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </values> this <values> element gets parsed at the start of the script, and whatever the involved expressions return at that point is what the given values will evaluate to. You'll notice that at this point in time the proper result for expressions.ratio_pxpermm is _not yet known_. You only determine that later, at runtime, during the calibration procedure. Long story short, you should not use <values> for the positions, but <expressions>, as in <expressions positions> /hp1 = 50% /hp2 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px * (display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </expressions> with <trial set3X1> / ontrialbegin = [values.fillerhpos1 = expressions.hp2] / ontrialbegin = [values.fillerhpos2 = expressions.hp3] / ontrialbegin = [values.fillerhpos3 = expressions.hp4] / ontrialbegin = [values.fillerhpos4 = expressions.hp5] / ontrialbegin = [values.fillerhpos4 = expressions.hp5] / ontrialbegin = [values.fillervpos1 = expressions.vp2] / ontrialbegin = [values.fillervpos2 = expressions.vp3] / ontrialbegin = [values.fillervpos3 = expressions.vp4] / ontrialbegin = [values.fillervpos4 = expressions.vp5] / ontrialbegin = [values.fillervpos4 = expressions.vp5] ... </trial> (and so forth) an expression will be evaluated every time you query it, i.e. it should return the correct result based on the calibration. Thank you so much for this, it works perfectly! I was hoping to apply the same logic to the size of my text stimuli. So have the font size defined by a value which is updated by an expression on the beginning of each trial - so that if the text stimuli is a "o" it is given a smaller font size and if it is a letter it is given a larger font size. But the letters all appear the same size and very small - like they have not been given a size? Why is this, can you not use this method with text? I have copied my script below.. <text s3filler1> / items = ("H", "Z", "o","M", "K", "o", "W", "H","o", "Z", "K", "o", "M","W", "o", "H", "Z", "o","M", "K", "o", "W", "H","o", "Z", "K", "o", "M","W", "o", "H", "Z", "o","M", "K", "o", "W", "H","o", "Z", "K", "o", "M","W", "o", "Z", "K", "o") / fontstyle = ("Arial Black", values.fontsize1,false, false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = values.fillerhpos1 / vposition = values.fillervpos1 </text> <values fontsizestorage> /fontsize1 = 0 /fontsize2 = 0 /fontsize3 = 0 /fontsize4 = 0 /fontsize5 = 0 </values> <values measurements> /fillerlettersize = 3.5 /lettersize = 8 </values> <expressions> / fillerfontsize = 1px * values.fillerlettersize *expressions.ratio_pxpermm / letterfontsize = 1px * values.lettersize *expressions.ratio_pxpermm </expressions> <trial set3X1> / ontrialbegin = [ if(text.s3filler1.currentitem= "o") values.fontsize1 =expressions.fillerfontsize elsevalues.fontsize1 = expressions.letterfontsize ] / ontrialbegin = [ if(text.s3filler2.currentitem= "o") values.fontsize2 =expressions.fillerfontsize elsevalues.fontsize2 = expressions.letterfontsize ] / ontrialbegin = [ if(text.s3filler3.currentitem= "o") values.fontsize3 =expressions.fillerfontsize elsevalues.fontsize3 = expressions.letterfontsize ] / ontrialbegin = [ if(text.s3filler4.currentitem= "o") values.fontsize4 =expressions.fillerfontsize elsevalues.fontsize4 = expressions.letterfontsize ] / ontrialbegin = [ if(text.s3filler5.currentitem= "o") values.fontsize5 =expressions.fillerfontsize elsevalues.fontsize5 = expressions.letterfontsize ] / ontrialbegin = [values.fillerhpos1 = expressions.hp2] / ontrialbegin = [values.fillerhpos2 = expressions.hp3] / ontrialbegin = [values.fillerhpos3 = expressions.hp4] / ontrialbegin = [values.fillerhpos4 = expressions.hp5] / ontrialbegin = [values.fillerhpos5 = expressions.hp6] / ontrialbegin = [values.fillervpos1 = expressions.vp2] / ontrialbegin = [values.fillervpos2 = expressions.vp3] / ontrialbegin = [values.fillervpos3 = expressions.vp4] / ontrialbegin = [values.fillervpos4 = expressions.vp5] / ontrialbegin = [values.fillervpos5 = expressions.vp6] / ontrialbegin =[trial.set3X1.insertstimulustime(list.distractorX1.nextvalue,500);] / ontrialbegin = [values.distractor =list.distractorX1.currentvalue;] / ontrialbegin = [ if(contains(list.distractorX1.currentvalue, "X")) values.category ="congruent"; else if(contains(list.distractorX1.currentvalue, "N")) values.category ="incongruent"; ] / ontrialend = [trial.set3X1.resetstimulusframes(); ] / stimulustimes = [1=fixation; 500=sequence (fixationcover,XLD1, s3filler1, s3filler2, s3filler3, s3filler4, s3filler5); 600=sequence(eraser1, eraser2, eraser3, eraser4, eraser5, eraser6)] / validresponse = ("J", "I") / correctresponse = ("J") / response = timeout(2000) / beginresponsetime = 500 </trial> Thanks for your help Ahh actually I have just tried using lists for the order of the text stimuli so that I can have the text separate with different sizes. Solved! Thanks for all your help with the locations!
|
|
|
jm560@sussex.ac.uk
|
|
Group: Forum Members
Posts: 25,
Visits: 208
|
+x+x+x+x+x Hi,
I am trying to make a script that has a lot of counterbalancing, because ofthis I need the locations of the various distractor stimuli to be dependent onthe trial type. I've been trying to do this with conditional statements butcan't get it to work. I've copied the relevant bits of script below (hopefully that's enough - I haven't changed the rest of the script yet so thought it would be more confusing to attach the whole thing). I'm trying to test it just on the h position of filler 1 but I would want to change v position too later. Any help/ suggestions of how else I could do this would be appreciated!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
<values> /hp1 = 50% /hp2 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2)- (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px *(display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </values> <trial lowX1> / ontrialbegin =[trial.lowX1.insertstimulustime(list.distractorXl1.nextvalue,500);] / ontrialbegin =[values.distractor = list.distractorXl1.currentvalue;] / ontrialbegin = [ if(contains(list.distractorXl1.currentvalue, "X")) values.category ="congruent"; else if(contains(list.distractorXl1.currentvalue, "N")) values.category ="incongruent"; ] / ontrialend =[trial.lowX1.resetstimulusframes(); ] / stimulustimes = [1=fixation;500=sequence (fixationcover, XLD1, filler1, filler2, filler3, filler4,filler5); 600=sequence (eraser1, eraser2, eraser3, eraser4, eraser5, eraser6)] / validresponse = ("J","I") / correctresponse =("J") / response = timeout(2000) / beginresponsetime = 500 </trial>
Thanks!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
This isn't valid syntax, there is no such thing as "trialcode", you're using the wrong operator etc. You should simply do something like this:
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = values.fillerhpos / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
with
<values> / fillerhpos = 0% / hp1 = 50% ... </values>
and then set the value in the respective <trial> elements, i.e.
<trial lowX1> / ontrialbegin = [values.fillerhpos = values.hp2] ... </trial>
<trial lowX2> / ontrialbegin = [values.fillerhpos = values.hp3] ... </trial>
and so forth. Ahh this makes much more sense! Thank you! Hi again, I've being trying to implement this and it works perfectly when using actual numbers but not when generating numbers using my calibration for absolute sizes. (the one provided in this post - https://www.millisecond.com/forums/Topic14608.aspx) I.e if hp1= 50% then that is fine and works but if hp1 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm then it stops working. I've used that expression throughout the experiment and it works fine. Perhaps inquisit can't load this quickly enough on a trial by trial basis? Is there a way around this? I get the following error messages when I try and run the script Expression 'values.linelength_px' is invalid. Expression contains an unknown element or property name. Error evaluating 'values.linelength_px/85.6': Expression contains an unknown element or property name. Error evaluating 'values.linelength_px/85.6': Unknown error. the value.linelength is part of the calibration script - which is used to calculate the expressions.ratio_pxpermm line in my script which seems to be the problem. Perhaps if my script found the value of expressions.ratio_pxpermm at the beginning of the experiment and used that value it would help? - i'm not sure how to do this... I've attached my currently non working script (which does work when you change the expression to actual numbers) here too Thanks, Jenny <values positions> /hp1 = 50% /hp2 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px * (display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </values> this <values> element gets parsed at the start of the script, and whatever the involved expressions return at that point is what the given values will evaluate to. You'll notice that at this point in time the proper result for expressions.ratio_pxpermm is _not yet known_. You only determine that later, at runtime, during the calibration procedure. Long story short, you should not use <values> for the positions, but <expressions>, as in <expressions positions> /hp1 = 50% /hp2 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px * (display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </expressions> with <trial set3X1> / ontrialbegin = [values.fillerhpos1 = expressions.hp2] / ontrialbegin = [values.fillerhpos2 = expressions.hp3] / ontrialbegin = [values.fillerhpos3 = expressions.hp4] / ontrialbegin = [values.fillerhpos4 = expressions.hp5] / ontrialbegin = [values.fillerhpos4 = expressions.hp5] / ontrialbegin = [values.fillervpos1 = expressions.vp2] / ontrialbegin = [values.fillervpos2 = expressions.vp3] / ontrialbegin = [values.fillervpos3 = expressions.vp4] / ontrialbegin = [values.fillervpos4 = expressions.vp5] / ontrialbegin = [values.fillervpos4 = expressions.vp5] ... </trial> (and so forth) an expression will be evaluated every time you query it, i.e. it should return the correct result based on the calibration. Thank you so much for this, it works perfectly! I was hoping to apply the same logic to the size of my text stimuli. So have the font size defined by a value which is updated by an expression on the beginning of each trial - so that if the text stimuli is a "o" it is given a smaller font size and if it is a letter it is given a larger font size. But the letters all appear the same size and very small - like they have not been given a size? Why is this, can you not use this method with text? I have copied my script below.. <text s3filler1> / items = ("H", "Z", "o","M", "K", "o", "W", "H","o", "Z", "K", "o", "M","W", "o", "H", "Z", "o","M", "K", "o", "W", "H","o", "Z", "K", "o", "M","W", "o", "H", "Z", "o","M", "K", "o", "W", "H","o", "Z", "K", "o", "M","W", "o", "Z", "K", "o") / fontstyle = ("Arial Black", values.fontsize1,false, false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = values.fillerhpos1 / vposition = values.fillervpos1 </text> <values fontsizestorage> /fontsize1 = 0 /fontsize2 = 0 /fontsize3 = 0 /fontsize4 = 0 /fontsize5 = 0 </values> <values measurements> /fillerlettersize = 3.5 /lettersize = 8 </values> <expressions> / fillerfontsize = 1px * values.fillerlettersize *expressions.ratio_pxpermm / letterfontsize = 1px * values.lettersize *expressions.ratio_pxpermm </expressions> <trial set3X1> / ontrialbegin = [ if(text.s3filler1.currentitem= "o") values.fontsize1 =expressions.fillerfontsize elsevalues.fontsize1 = expressions.letterfontsize ] / ontrialbegin = [ if(text.s3filler2.currentitem= "o") values.fontsize2 =expressions.fillerfontsize elsevalues.fontsize2 = expressions.letterfontsize ] / ontrialbegin = [ if(text.s3filler3.currentitem= "o") values.fontsize3 =expressions.fillerfontsize elsevalues.fontsize3 = expressions.letterfontsize ] / ontrialbegin = [ if(text.s3filler4.currentitem= "o") values.fontsize4 =expressions.fillerfontsize elsevalues.fontsize4 = expressions.letterfontsize ] / ontrialbegin = [ if(text.s3filler5.currentitem= "o") values.fontsize5 =expressions.fillerfontsize elsevalues.fontsize5 = expressions.letterfontsize ] / ontrialbegin = [values.fillerhpos1 = expressions.hp2] / ontrialbegin = [values.fillerhpos2 = expressions.hp3] / ontrialbegin = [values.fillerhpos3 = expressions.hp4] / ontrialbegin = [values.fillerhpos4 = expressions.hp5] / ontrialbegin = [values.fillerhpos5 = expressions.hp6] / ontrialbegin = [values.fillervpos1 = expressions.vp2] / ontrialbegin = [values.fillervpos2 = expressions.vp3] / ontrialbegin = [values.fillervpos3 = expressions.vp4] / ontrialbegin = [values.fillervpos4 = expressions.vp5] / ontrialbegin = [values.fillervpos5 = expressions.vp6] / ontrialbegin =[trial.set3X1.insertstimulustime(list.distractorX1.nextvalue,500);] / ontrialbegin = [values.distractor =list.distractorX1.currentvalue;] / ontrialbegin = [ if(contains(list.distractorX1.currentvalue, "X")) values.category ="congruent"; else if(contains(list.distractorX1.currentvalue, "N")) values.category ="incongruent"; ] / ontrialend = [trial.set3X1.resetstimulusframes(); ] / stimulustimes = [1=fixation; 500=sequence (fixationcover,XLD1, s3filler1, s3filler2, s3filler3, s3filler4, s3filler5); 600=sequence(eraser1, eraser2, eraser3, eraser4, eraser5, eraser6)] / validresponse = ("J", "I") / correctresponse = ("J") / response = timeout(2000) / beginresponsetime = 500 </trial> Thanks for your help
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+x+x Hi,
I am trying to make a script that has a lot of counterbalancing, because ofthis I need the locations of the various distractor stimuli to be dependent onthe trial type. I've been trying to do this with conditional statements butcan't get it to work. I've copied the relevant bits of script below (hopefully that's enough - I haven't changed the rest of the script yet so thought it would be more confusing to attach the whole thing). I'm trying to test it just on the h position of filler 1 but I would want to change v position too later. Any help/ suggestions of how else I could do this would be appreciated!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
<values> /hp1 = 50% /hp2 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2)- (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px *(display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </values> <trial lowX1> / ontrialbegin =[trial.lowX1.insertstimulustime(list.distractorXl1.nextvalue,500);] / ontrialbegin =[values.distractor = list.distractorXl1.currentvalue;] / ontrialbegin = [ if(contains(list.distractorXl1.currentvalue, "X")) values.category ="congruent"; else if(contains(list.distractorXl1.currentvalue, "N")) values.category ="incongruent"; ] / ontrialend =[trial.lowX1.resetstimulusframes(); ] / stimulustimes = [1=fixation;500=sequence (fixationcover, XLD1, filler1, filler2, filler3, filler4,filler5); 600=sequence (eraser1, eraser2, eraser3, eraser4, eraser5, eraser6)] / validresponse = ("J","I") / correctresponse =("J") / response = timeout(2000) / beginresponsetime = 500 </trial>
Thanks!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
This isn't valid syntax, there is no such thing as "trialcode", you're using the wrong operator etc. You should simply do something like this:
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = values.fillerhpos / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
with
<values> / fillerhpos = 0% / hp1 = 50% ... </values>
and then set the value in the respective <trial> elements, i.e.
<trial lowX1> / ontrialbegin = [values.fillerhpos = values.hp2] ... </trial>
<trial lowX2> / ontrialbegin = [values.fillerhpos = values.hp3] ... </trial>
and so forth. Ahh this makes much more sense! Thank you! Hi again, I've being trying to implement this and it works perfectly when using actual numbers but not when generating numbers using my calibration for absolute sizes. (the one provided in this post - https://www.millisecond.com/forums/Topic14608.aspx) I.e if hp1= 50% then that is fine and works but if hp1 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm then it stops working. I've used that expression throughout the experiment and it works fine. Perhaps inquisit can't load this quickly enough on a trial by trial basis? Is there a way around this? I get the following error messages when I try and run the script Expression 'values.linelength_px' is invalid. Expression contains an unknown element or property name. Error evaluating 'values.linelength_px/85.6': Expression contains an unknown element or property name. Error evaluating 'values.linelength_px/85.6': Unknown error. the value.linelength is part of the calibration script - which is used to calculate the expressions.ratio_pxpermm line in my script which seems to be the problem. Perhaps if my script found the value of expressions.ratio_pxpermm at the beginning of the experiment and used that value it would help? - i'm not sure how to do this... I've attached my currently non working script (which does work when you change the expression to actual numbers) here too Thanks, Jenny <values positions> /hp1 = 50% /hp2 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px * (display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </values> this <values> element gets parsed at the start of the script, and whatever the involved expressions return at that point is what the given values will evaluate to. You'll notice that at this point in time the proper result for expressions.ratio_pxpermm is _not yet known_. You only determine that later, at runtime, during the calibration procedure. Long story short, you should not use <values> for the positions, but <expressions>, as in <expressions positions> /hp1 = 50% /hp2 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px * (display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px * (display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px * (display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px * (display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </expressions> with <trial set3X1> / ontrialbegin = [values.fillerhpos1 = expressions.hp2] / ontrialbegin = [values.fillerhpos2 = expressions.hp3] / ontrialbegin = [values.fillerhpos3 = expressions.hp4] / ontrialbegin = [values.fillerhpos4 = expressions.hp5] / ontrialbegin = [values.fillerhpos4 = expressions.hp5] / ontrialbegin = [values.fillervpos1 = expressions.vp2] / ontrialbegin = [values.fillervpos2 = expressions.vp3] / ontrialbegin = [values.fillervpos3 = expressions.vp4] / ontrialbegin = [values.fillervpos4 = expressions.vp5] / ontrialbegin = [values.fillervpos4 = expressions.vp5] ... </trial> (and so forth) an expression will be evaluated every time you query it, i.e. it should return the correct result based on the calibration.
|
|
|
jm560@sussex.ac.uk
|
|
Group: Forum Members
Posts: 25,
Visits: 208
|
+x+x+x Hi,
I am trying to make a script that has a lot of counterbalancing, because ofthis I need the locations of the various distractor stimuli to be dependent onthe trial type. I've been trying to do this with conditional statements butcan't get it to work. I've copied the relevant bits of script below (hopefully that's enough - I haven't changed the rest of the script yet so thought it would be more confusing to attach the whole thing). I'm trying to test it just on the h position of filler 1 but I would want to change v position too later. Any help/ suggestions of how else I could do this would be appreciated!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
<values> /hp1 = 50% /hp2 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2)- (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px *(display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </values> <trial lowX1> / ontrialbegin =[trial.lowX1.insertstimulustime(list.distractorXl1.nextvalue,500);] / ontrialbegin =[values.distractor = list.distractorXl1.currentvalue;] / ontrialbegin = [ if(contains(list.distractorXl1.currentvalue, "X")) values.category ="congruent"; else if(contains(list.distractorXl1.currentvalue, "N")) values.category ="incongruent"; ] / ontrialend =[trial.lowX1.resetstimulusframes(); ] / stimulustimes = [1=fixation;500=sequence (fixationcover, XLD1, filler1, filler2, filler3, filler4,filler5); 600=sequence (eraser1, eraser2, eraser3, eraser4, eraser5, eraser6)] / validresponse = ("J","I") / correctresponse =("J") / response = timeout(2000) / beginresponsetime = 500 </trial>
Thanks!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
This isn't valid syntax, there is no such thing as "trialcode", you're using the wrong operator etc. You should simply do something like this:
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = values.fillerhpos / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
with
<values> / fillerhpos = 0% / hp1 = 50% ... </values>
and then set the value in the respective <trial> elements, i.e.
<trial lowX1> / ontrialbegin = [values.fillerhpos = values.hp2] ... </trial>
<trial lowX2> / ontrialbegin = [values.fillerhpos = values.hp3] ... </trial>
and so forth. Ahh this makes much more sense! Thank you! Hi again, I've being trying to implement this and it works perfectly when using actual numbers but not when generating numbers using my calibration for absolute sizes. (the one provided in this post - https://www.millisecond.com/forums/Topic14608.aspx) I.e if hp1= 50% then that is fine and works but if hp1 = 1px * (display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm then it stops working. I've used that expression throughout the experiment and it works fine. Perhaps inquisit can't load this quickly enough on a trial by trial basis? Is there a way around this? I get the following error messages when I try and run the script Expression 'values.linelength_px' is invalid. Expression contains an unknown element or property name. Error evaluating 'values.linelength_px/85.6': Expression contains an unknown element or property name. Error evaluating 'values.linelength_px/85.6': Unknown error. the value.linelength is part of the calibration script - which is used to calculate the expressions.ratio_pxpermm line in my script which seems to be the problem. Perhaps if my script found the value of expressions.ratio_pxpermm at the beginning of the experiment and used that value it would help? - i'm not sure how to do this... I've attached my currently non working script (which does work when you change the expression to actual numbers) here too Thanks, Jenny
|
|
|
jm560@sussex.ac.uk
|
|
Group: Forum Members
Posts: 25,
Visits: 208
|
+x+x Hi,
I am trying to make a script that has a lot of counterbalancing, because ofthis I need the locations of the various distractor stimuli to be dependent onthe trial type. I've been trying to do this with conditional statements butcan't get it to work. I've copied the relevant bits of script below (hopefully that's enough - I haven't changed the rest of the script yet so thought it would be more confusing to attach the whole thing). I'm trying to test it just on the h position of filler 1 but I would want to change v position too later. Any help/ suggestions of how else I could do this would be appreciated!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
<values> /hp1 = 50% /hp2 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2)- (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px *(display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </values> <trial lowX1> / ontrialbegin =[trial.lowX1.insertstimulustime(list.distractorXl1.nextvalue,500);] / ontrialbegin =[values.distractor = list.distractorXl1.currentvalue;] / ontrialbegin = [ if(contains(list.distractorXl1.currentvalue, "X")) values.category ="congruent"; else if(contains(list.distractorXl1.currentvalue, "N")) values.category ="incongruent"; ] / ontrialend =[trial.lowX1.resetstimulusframes(); ] / stimulustimes = [1=fixation;500=sequence (fixationcover, XLD1, filler1, filler2, filler3, filler4,filler5); 600=sequence (eraser1, eraser2, eraser3, eraser4, eraser5, eraser6)] / validresponse = ("J","I") / correctresponse =("J") / response = timeout(2000) / beginresponsetime = 500 </trial>
Thanks!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
This isn't valid syntax, there is no such thing as "trialcode", you're using the wrong operator etc. You should simply do something like this:
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = values.fillerhpos / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
with
<values> / fillerhpos = 0% / hp1 = 50% ... </values>
and then set the value in the respective <trial> elements, i.e.
<trial lowX1> / ontrialbegin = [values.fillerhpos = values.hp2] ... </trial>
<trial lowX2> / ontrialbegin = [values.fillerhpos = values.hp3] ... </trial>
and so forth. Ahh this makes much more sense! Thank you!
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x Hi,
I am trying to make a script that has a lot of counterbalancing, because ofthis I need the locations of the various distractor stimuli to be dependent onthe trial type. I've been trying to do this with conditional statements butcan't get it to work. I've copied the relevant bits of script below (hopefully that's enough - I haven't changed the rest of the script yet so thought it would be more confusing to attach the whole thing). I'm trying to test it just on the h position of filler 1 but I would want to change v position too later. Any help/ suggestions of how else I could do this would be appreciated!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
<values> /hp1 = 50% /hp2 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2)- (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px *(display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </values> <trial lowX1> / ontrialbegin =[trial.lowX1.insertstimulustime(list.distractorXl1.nextvalue,500);] / ontrialbegin =[values.distractor = list.distractorXl1.currentvalue;] / ontrialbegin = [ if(contains(list.distractorXl1.currentvalue, "X")) values.category ="congruent"; else if(contains(list.distractorXl1.currentvalue, "N")) values.category ="incongruent"; ] / ontrialend =[trial.lowX1.resetstimulusframes(); ] / stimulustimes = [1=fixation;500=sequence (fixationcover, XLD1, filler1, filler2, filler3, filler4,filler5); 600=sequence (eraser1, eraser2, eraser3, eraser4, eraser5, eraser6)] / validresponse = ("J","I") / correctresponse =("J") / response = timeout(2000) / beginresponsetime = 500 </trial>
Thanks!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
This isn't valid syntax, there is no such thing as "trialcode", you're using the wrong operator etc. You should simply do something like this:
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = values.fillerhpos / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
with
<values> / fillerhpos = 0% / hp1 = 50% ... </values>
and then set the value in the respective <trial> elements, i.e.
<trial lowX1> / ontrialbegin = [values.fillerhpos = values.hp2] ... </trial>
<trial lowX2> / ontrialbegin = [values.fillerhpos = values.hp3] ... </trial>
and so forth.
|
|
|
jm560@sussex.ac.uk
|
|
Group: Forum Members
Posts: 25,
Visits: 208
|
Hi,
I am trying to make a script that has a lot of counterbalancing, because ofthis I need the locations of the various distractor stimuli to be dependent onthe trial type. I've been trying to do this with conditional statements butcan't get it to work. I've copied the relevant bits of script below (hopefully that's enough - I haven't changed the rest of the script yet so thought it would be more confusing to attach the whole thing). I'm trying to test it just on the h position of filler 1 but I would want to change v position too later. Any help/ suggestions of how else I could do this would be appreciated!
<text filler1> / items = ("H", "Z", "o", "M","K", "o") / fontstyle = ("Arial Black", expressions.letterfontsize, false,false, false, false) / txcolor = black / select =sequence / txbgcolor = darkgrey / hposition = [ if (trialcode=trial.lowX1)values.hp2 else if(trialcode=trial.lowX2)values.hp3 else if (trialcode=trial.lowX3)values.hp4else if (trialcode=trial.lowX4)values.hp5 ] / vposition = 1px * (display.canvasheight/2) - (values.p1distance/2) * expressions.ratio_pxpermm </text>
<values> /hp1 = 50% /hp2 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp3 = 1px *(display.canvaswidth/2) + (values.p23horizontal/2) * expressions.ratio_pxpermm /hp4 = 50% /hp5 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /hp6 = 1px *(display.canvaswidth/2) - (values.p56horizontal/2) * expressions.ratio_pxpermm /vp1 = 1px * (display.canvasheight/2)- (values.p1distance/2) * expressions.ratio_pxpermm /vp2 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm /vp3 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp4 = 1px *(display.canvasheight/2) + (values.p4distance/2) * expressions.ratio_pxpermm /vp5 = 1px *(display.canvasheight/2) - (values.p35vertical/2) * expressions.ratio_pxpermm /vp6 = 1px *(display.canvasheight/2) + (values.p26vertical/2) * expressions.ratio_pxpermm </values> <trial lowX1> / ontrialbegin =[trial.lowX1.insertstimulustime(list.distractorXl1.nextvalue,500);] / ontrialbegin =[values.distractor = list.distractorXl1.currentvalue;] / ontrialbegin = [ if(contains(list.distractorXl1.currentvalue, "X")) values.category ="congruent"; else if(contains(list.distractorXl1.currentvalue, "N")) values.category ="incongruent"; ] / ontrialend =[trial.lowX1.resetstimulusframes(); ] / stimulustimes = [1=fixation;500=sequence (fixationcover, XLD1, filler1, filler2, filler3, filler4,filler5); 600=sequence (eraser1, eraser2, eraser3, eraser4, eraser5, eraser6)] / validresponse = ("J","I") / correctresponse =("J") / response = timeout(2000) / beginresponsetime = 500 </trial>
Thanks!
|
|
|