Group: Forum Members
Posts: 14,
Visits: 53
|
+x+x+x+x+x+x+x+x+x+xThank you Dave, is there a way of knowing which image of the four images the participant has been presented with, is clicked on? Because at the moment I have coded /validresponse=(picture.c1TL, picture.c1_TR, picture.c1_BL, picture.c1BR). But when changing the trial code stimulus times to: <trial trial1a> /ontrialbegin = [values.h = list.hlist.nextvalue; values.v = list.vlist.nextvalue;] /ontrialbegin = [values.condition = "C1 Raincoat"] /ontrialbegin = [values.currentsoa = 150] /stimulustimes = [1000 = background; 1000 = fixation; 2000 = eraser; 2001 = picture.c1; 2500 = picture.advert; 2650 = picture.c1;] /beginresponsetime = (2650) /inputdevice=mouse /validresponse=(picture.c1_TL, picture.c1_TR, picture.c1_BL, picture.c1_BR) /ontrialend = [values.x=trial.trial1a.responsex;values.y=trial.trial1a.responsey] /recorddata = true My valid response item becomes invalid? And if I change the valid response item to 'c1' it does not show which image individually was clicked on in my data file. Many thanks in advance. I don't understand that question or code. If you want to display four (or less, it's not clear to me) different images during a single instance of the <trial>, you still need four <picture> elements, the position <list>s don't change that. I.e. /stimulustimes = [1000 = background; 1000 = fixation; 2000 = eraser; 2001 = picture.c1; 2500 = picture.advert; 2650 = picture.c1;] . doesn't make sense *unless* you want to display the same image item *twice* during the trial, once at 2001 and a second time at 2650. <picture c1> will not display different items during a single instance of the trial, nor will it appear in different positions during a single instance of the trial. If you merely wish to know *which* single item <picture c1> displayed during a given instance of a <trial>, you can log that picture element's currentitem property to the data file. Sorry, this is a bit confusing to describe verbally, I have attached an image of the screen I would like people to see. I have so far, coded each image to be in a predetermined position. I would like all 4 to appear at the same time, but am now wanting to make them to appear in random positions. I would like the images to appear at 2001 and 2650, and the participant must click on one to continue. However if I can get them to randomly position, I then am unsure how to code the validresponse = in a way that I will know which image the participant has clicked on. I hope that makes more sense and I am sorry for all the questions! You need four <picture> elements, one per image. You can then randomize their positions per two <list> elements as already illustrated. You the response to the <trial> tells you which picture element was clicked. Here's the same thing using <text> elements as an example: <values> / h1 = 0% / v1 = 0% / h2 = 0% / v2 = 0% / h3 = 0% / v3 = 0% / h4 = 0% / v4 = 0% </values> <list hpositions> / items = (40%, 60%, 40%, 60%) / selectionrate = always </list> <list vpositions> / items = (25%, 25%, 75%, 75%) / selectionmode = list.hpositions.currentindex / selectionrate = always </list> <text object_blue> / items = ("Blue Object") / txcolor = blue / hposition = values.h1 / vposition = values.v1 </text> <text object_green> / items = ("Green Object") / txcolor = green / hposition = values.h2 / vposition = values.v2 </text> <text object_red> / items = ("Red Object") / txcolor = red / hposition = values.h3 / vposition = values.v3 </text> <text object_yellow> / items = ("Yellow Object") / txcolor = yellow / hposition = values.h4 / vposition = values.v4 </text> <trial example> / ontrialbegin = [ values.h1 = list.hpositions.nextvalue; values.v1 = list.vpositions.nextvalue; values.h2 = list.hpositions.nextvalue; values.v2 = list.vpositions.nextvalue; values.h3 = list.hpositions.nextvalue; values.v3 = list.vpositions.nextvalue; values.h4 = list.hpositions.nextvalue; values.v4 = list.vpositions.nextvalue; ] / stimulustimes = [0=object_blue, object_green, object_red, object_yellow] / validresponse = (object_blue, object_green, object_red, object_yellow) / inputdevice = mouse </trial> <block myblock> / trials = [1-10 = example] </block> It works exactly the same way with <picture> elements. Thank you Dave that worked perfectly! Is there a way of coding the data to show which image was shown in each of the 4 positions, (i.e. have a data column for the 4 positions, showing which image was in each position) rather than having to have a column for the each of the potential images (which shows the position of the image if shown)? Because I have 10 trials = 40 images in total, which would be a lot of columns! > Is there a way of coding the data to show which image was shown in each of the 4 positions Yes, log the values pairs values.h1 / values.v1 to values.h4 / values.v4 to the data file. How do I get the names of the items in the position, rather than the numeric value of the position? At the moment I put values.h1, etc, and got the numeric value of the position eg. 75? Thank you! As discussed previously, you can do that by either logging the <picture> elements' currentitem properties directly or storing them in values and logging the values instead: <values> / h1 = 0% / v1 = 0% / h2 = 0% / v2 = 0% / h3 = 0% / v3 = 0% / h4 = 0% / v4 = 0% / object_blue = "" / object_green = "" / object_red = "" / object_yellow = "" </values> <list hpositions> / items = (40%, 60%, 40%, 60%) / selectionrate = always </list> <list vpositions> / items = (25%, 25%, 75%, 75%) / selectionmode = list.hpositions.currentindex / selectionrate = always </list> <text object_blue> / items = blueobjects / txcolor = blue / hposition = values.h1 / vposition = values.v1 </text> <text object_green> / items = greenobjects / txcolor = green / select = text.object_blue.currentindex / hposition = values.h2 / vposition = values.v2 </text> <text object_red> / items = redobjects / txcolor = red / select = text.object_blue.currentindex / hposition = values.h3 / vposition = values.v3 </text> <text object_yellow> / items = yellowobjects / txcolor = yellow / select = text.object_blue.currentindex / hposition = values.h4 / vposition = values.v4 </text> <item blueobjects> / 1 = "Blue Umbrella" / 2 = "Blue Car" / 3 = "Blue Bottle" / 4 = "Blue House" </item> <item greenobjects> / 1 = "Green Umbrella" / 2 = "Green Car" / 3 = "Green Bottle" / 4 = "Green House" </item> <item redobjects> / 1 = "Red Umbrella" / 2 = "Red Car" / 3 = "Red Bottle" / 4 = "Red House" </item> <item yellowobjects> / 1 = "Yellow Umbrella" / 2 = "Yellow Car" / 3 = "Yellow Bottle" / 4 = "Yellow House" </item> <trial example> / ontrialbegin = [ values.h1 = list.hpositions.nextvalue; values.v1 = list.vpositions.nextvalue; values.h2 = list.hpositions.nextvalue; values.v2 = list.vpositions.nextvalue; values.h3 = list.hpositions.nextvalue; values.v3 = list.vpositions.nextvalue; values.h4 = list.hpositions.nextvalue; values.v4 = list.vpositions.nextvalue; ] / ontrialend = [ values.object_blue = text.object_blue.currentitem; values.object_green = text.object_green.currentitem; values.object_red = text.object_red.currentitem; values.object_yellow = text.object_yellow.currentitem; ] / stimulustimes = [0=object_blue, object_green, object_red, object_yellow] / validresponse = (object_blue, object_green, object_red, object_yellow) / inputdevice = mouse </trial> <block myblock> / trials = [1-4 = example] </block> <data> / columns = (date time subject group blocknum blockcode trialnum trialcode response latency correct values.object_blue values.object_green values.object_red values.object_yellow) </data> I have tried these suggestions and I am unsure if they are not working because i have coded the images slightly differently.. This is the code I have, which works but does not display where each of the four images is presented. I would like to be able to just know which position 'targetsr, targetsb, targetsy and targetsg' are, but I realise that as they are only /items, I cannot use them in the same way as you used the /pictures. However I do not want a column for each of the 40 variations of c1r etc I have if possible. I'm not sure if it is easier for you to see what I mean by posting relevant bits of code, or attaching the file, so have done both. <item targetsr> /1 = "c1r.jpg" /2 = "c2r.jpg" /3 = "c3r.jpg" /4 = "c4r.jpg" /5 = "c5r.jpg" /6 = "c6r.jpg" /7 = "c7r.jpg" /8 = "c8r.jpg" /9 = "c9r.jpg" /10 = "c10r.jpg" </item> <item targetsb> /1 = "c1b.jpg" /2 = "c2b.jpg" /3 = "c3b.jpg" /4 = "c4b.jpg" /5 = "c5b.jpg" /6 = "c6b.jpg" /7 = "c7b.jpg" /8 = "c8b.jpg" /9 = "c9b.jpg" /10 = "c10b.jpg" </item> <item targetsy> /1 = "c1y.jpg" /2 = "c2y.jpg" /3 = "c3y.jpg" /4 = "c4y.jpg" /5 = "c5y.jpg" /6 = "c6y.jpg" /7 = "c7y.jpg" /8 = "c8y.jpg" /9 = "c9y.jpg" /10 = "c10y.jpg" </item> <item targetsg> /1 = "c1g.jpg" /2 = "c2g.jpg" /3 = "c3g.jpg" /4 = "c4g.jpg" /5 = "c5g.jpg" /6 = "c6g.jpg" /7 = "c7g.jpg" /8 = "c8g.jpg" /9 = "c9g.jpg" /10 = "c10g.jpg" </item> ******************** raw data ******************** <data> / separatefiles = true / columns = (build, date, time, subject, group, blockcode, trialcode, trialnum, values.condition, values.currentSOA, trialduration, response, latency,values.x, values.y, picture.advert.currentitem, picture.advert.hposition, picture.advert.vposition) </data> <values> /completed = 0 /currentSOA = 0 /condition = "" /soa_remaining = 0 /counttrials = 0 /countcorrect = 0 /sumrt= 0 /x = 0 /y = 0 /h = 0% /v = 0% /h1 = 0% /v1 = 0% /h2 = 0% /v2 = 0% /h3 = 0% /v3 = 0% /h4 = 0% /v4 = 0% </values> ********************************* Targets ********************************* <list hpositions> /items = (25%, 75%, 25%, 75%) / selectionrate = always </list> <list vpositions> /items = (45%, 45%, 75%, 75%) /selectionmode = list.hpositions.currentindex / selectionrate = always </list> IMAGES shown in 1 trial (I have 10 trials in total) ******************* <picture c1b> /items = targetsb /select = 1 /size = (35%,35%) / hposition = values.h1 / vposition = values.v1 </picture> <picture c1y> /items = targetsy /select = 1 /size = (35%,35%) / hposition = values.h2 / vposition = values.v2 </picture> <picture c1r> /items = targetsr /select = 1 /size = (35%,35%) / hposition = values.h3 / vposition = values.v3 </picture> <picture c1g> /items = targetsg /select = 1 /size = (35%,35%) / hposition = values.h4 / vposition = values.v4 </picture> ************************** Target trials ************************** <trial trial1a> /ontrialbegin = [values.h = list.hlist.nextvalue; values.v = list.vlist.nextvalue;] / ontrialbegin = [ values.h1 = list.hpositions.nextvalue; values.v1 = list.vpositions.nextvalue; values.h2 = list.hpositions.nextvalue; values.v2 = list.vpositions.nextvalue; values.h3 = list.hpositions.nextvalue; values.v3 = list.vpositions.nextvalue; values.h4 = list.hpositions.nextvalue; values.v4 = list.vpositions.nextvalue;] /ontrialbegin = [values.condition = "C1 Raincoat"] /ontrialbegin = [values.currentsoa = 150] /stimulustimes = [1000 = background; 1000 = fixation; 2000 = eraser; 2001 = picture.c1r, picture.c1b, picture.c1y, picture.c1g; 2500 = picture.advert; 2650 = picture.c1r, picture.c1b, picture.c1y, picture.c1g;] /beginresponsetime = (2650) /inputdevice=mouse /validresponse=(picture.c1r, picture.c1b, picture.c1y, picture.c1g) /ontrialend = [values.x=trial.trial1a.responsex;values.y=trial.trial1a.responsey] /recorddata = true </trial> values.h1 and values.v1 tell you where <picture c1b> was presented. <picture c1b> is what displays your targetsb items. values.h2 and values.v2 tell you where <picture c1y> was presented. <picture c1y> is what displays your targetsy items. values.h3 and values.v3 tell you where <picture c1r> was presented. <picture c1r> is what displays your targetsr items. values.h3 and values.v3 tell you where <picture c1g> was presented. <picture c1g>is what displays your targetsg items. Why don't you simply log those values to the data file? Ah I understand what you mean, okay this does do that. Is there not a way of having the location (four locations of the image available) as the column, and then the name of the item that is placed each location as the generated data?
|
Group: Administrators
Posts: 13K,
Visits: 103K
|
+xAh I understand what you mean, okay this does do that. Is there not a way of having the location (four locations of the image available) as the column, and then the name of the item that is placed each location as the generated data? You can achieve that too via conditional logic in /ontrialend: Check which object is in which position -- here numbered position 1 to 4, left to right, top then bottom -- i.e. position 1 position 2 position 3 position 4 by examining the respective h/v coordinates and then store the respective object's currentitem in a value which you log to the data file: <values> / h1 = 0% / v1 = 0% / h2 = 0% / v2 = 0% / h3 = 0% / v3 = 0% / h4 = 0% / v4 = 0% / item_in_position1 = "" / item_in_position2 = "" / item_in_position3= "" / item_in_position4 = "" / object_blue = "" / object_green = "" / object_red = "" / object_yellow = "" </values> <list hpositions> / items = (40%, 60%, 40%, 60%) / selectionrate = always </list> <list vpositions> / items = (25%, 25%, 75%, 75%) / selectionmode = list.hpositions.currentindex / selectionrate = always </list> <text object_blue> / items = blueobjects / txcolor = blue / hposition = values.h1 / vposition = values.v1 </text> <text object_green> / items = greenobjects / txcolor = green / select = text.object_blue.currentindex / hposition = values.h2 / vposition = values.v2 </text> <text object_red> / items = redobjects / txcolor = red / select = text.object_blue.currentindex / hposition = values.h3 / vposition = values.v3 </text> <text object_yellow> / items = yellowobjects / txcolor = yellow / select = text.object_blue.currentindex / hposition = values.h4 / vposition = values.v4 </text> <item blueobjects> / 1 = "Blue Umbrella" / 2 = "Blue Car" / 3 = "Blue Bottle" / 4 = "Blue House" </item> <item greenobjects> / 1 = "Green Umbrella" / 2 = "Green Car" / 3 = "Green Bottle" / 4 = "Green House" </item> <item redobjects> / 1 = "Red Umbrella" / 2 = "Red Car" / 3 = "Red Bottle" / 4 = "Red House" </item> <item yellowobjects> / 1 = "Yellow Umbrella" / 2 = "Yellow Car" / 3 = "Yellow Bottle" / 4 = "Yellow House" </item> <trial example> / ontrialbegin = [ values.h1 = list.hpositions.nextvalue; values.v1 = list.vpositions.nextvalue; values.h2 = list.hpositions.nextvalue; values.v2 = list.vpositions.nextvalue; values.h3 = list.hpositions.nextvalue; values.v3 = list.vpositions.nextvalue; values.h4 = list.hpositions.nextvalue; values.v4 = list.vpositions.nextvalue; ] / ontrialend = [ values.object_blue = text.object_blue.currentitem; values.object_green = text.object_green.currentitem; values.object_red = text.object_red.currentitem; values.object_yellow = text.object_yellow.currentitem; ] / ontrialend = [ if (values.h1 == 40% && values.v1 == 25%) { values.item_in_position1 = text.object_blue.currentitem; } else if (values.h1 == 60% && values.v1 == 25%) { values.item_in_position2 = text.object_blue.currentitem; } else if (values.h1 == 40% && values.v1 == 75%) { values.item_in_position3 = text.object_blue.currentitem; } else if (values.h1 == 60% && values.v1 == 75%) { values.item_in_position4 = text.object_blue.currentitem; } ] / ontrialend = [ if (values.h2 == 40% && values.v2 == 25%) { values.item_in_position1 = text.object_green.currentitem; } else if (values.h2 == 60% && values.v2 == 25%) { values.item_in_position2 = text.object_green.currentitem; } else if (values.h2 == 40% && values.v2 == 75%) { values.item_in_position3 = text.object_green.currentitem; } else if (values.h2 == 60% && values.v2 == 75%) { values.item_in_position4 = text.object_green.currentitem; } ] / ontrialend = [ if (values.h3 == 40% && values.v3 == 25%) { values.item_in_position1 = text.object_red.currentitem; } else if (values.h3 == 60% && values.v3 == 25%) { values.item_in_position2 = text.object_red.currentitem; } else if (values.h3 == 40% && values.v3 == 75%) { values.item_in_position3 = text.object_red.currentitem; } else if (values.h3 == 60% && values.v3 == 75%) { values.item_in_position4 = text.object_red.currentitem; } ] / ontrialend = [ if (values.h4 == 40% && values.v4 == 25%) { values.item_in_position1 = text.object_yellow.currentitem; } else if (values.h4 == 60% && values.v4 == 25%) { values.item_in_position2 = text.object_yellow.currentitem; } else if (values.h4 == 40% && values.v4 == 75%) { values.item_in_position3 = text.object_yellow.currentitem; } else if (values.h4 == 60% && values.v4 == 75%) { values.item_in_position4 = text.object_yellow.currentitem; } ]/ stimulustimes = [0=object_blue, object_green, object_red, object_yellow] / validresponse = (object_blue, object_green, object_red, object_yellow) / inputdevice = mouse </trial> <block myblock> / trials = [1-4 = example] </block> <data> / columns = (date time subject group blocknum blockcode trialnum trialcode response latency correct values.item_in_position1 values.item_in_position2 values.item_in_position3 values.item_in_position4) </data>
|
Group: Forum Members
Posts: 14,
Visits: 53
|
+x+xAh I understand what you mean, okay this does do that. Is there not a way of having the location (four locations of the image available) as the column, and then the name of the item that is placed each location as the generated data? You can achieve that too via conditional logic in /ontrialend: Check which object is in which position -- here numbered position 1 to 4, left to right, top then bottom -- i.e. position 1 position 2 position 3 position 4 by examining the respective h/v coordinates and then store the respective object's currentitem in a value which you log to the data file: <values> / h1 = 0% / v1 = 0% / h2 = 0% / v2 = 0% / h3 = 0% / v3 = 0% / h4 = 0% / v4 = 0% / item_in_position1 = "" / item_in_position2 = "" / item_in_position3= "" / item_in_position4 = "" / object_blue = "" / object_green = "" / object_red = "" / object_yellow = "" </values> <list hpositions> / items = (40%, 60%, 40%, 60%) / selectionrate = always </list> <list vpositions> / items = (25%, 25%, 75%, 75%) / selectionmode = list.hpositions.currentindex / selectionrate = always </list> <text object_blue> / items = blueobjects / txcolor = blue / hposition = values.h1 / vposition = values.v1 </text> <text object_green> / items = greenobjects / txcolor = green / select = text.object_blue.currentindex / hposition = values.h2 / vposition = values.v2 </text> <text object_red> / items = redobjects / txcolor = red / select = text.object_blue.currentindex / hposition = values.h3 / vposition = values.v3 </text> <text object_yellow> / items = yellowobjects / txcolor = yellow / select = text.object_blue.currentindex / hposition = values.h4 / vposition = values.v4 </text> <item blueobjects> / 1 = "Blue Umbrella" / 2 = "Blue Car" / 3 = "Blue Bottle" / 4 = "Blue House" </item> <item greenobjects> / 1 = "Green Umbrella" / 2 = "Green Car" / 3 = "Green Bottle" / 4 = "Green House" </item> <item redobjects> / 1 = "Red Umbrella" / 2 = "Red Car" / 3 = "Red Bottle" / 4 = "Red House" </item> <item yellowobjects> / 1 = "Yellow Umbrella" / 2 = "Yellow Car" / 3 = "Yellow Bottle" / 4 = "Yellow House" </item> <trial example> / ontrialbegin = [ values.h1 = list.hpositions.nextvalue; values.v1 = list.vpositions.nextvalue; values.h2 = list.hpositions.nextvalue; values.v2 = list.vpositions.nextvalue; values.h3 = list.hpositions.nextvalue; values.v3 = list.vpositions.nextvalue; values.h4 = list.hpositions.nextvalue; values.v4 = list.vpositions.nextvalue; ] / ontrialend = [ values.object_blue = text.object_blue.currentitem; values.object_green = text.object_green.currentitem; values.object_red = text.object_red.currentitem; values.object_yellow = text.object_yellow.currentitem; ] / ontrialend = [ if (values.h1 == 40% && values.v1 == 25%) { values.item_in_position1 = text.object_blue.currentitem; } else if (values.h1 == 60% && values.v1 == 25%) { values.item_in_position2 = text.object_blue.currentitem; } else if (values.h1 == 40% && values.v1 == 75%) { values.item_in_position3 = text.object_blue.currentitem; } else if (values.h1 == 60% && values.v1 == 75%) { values.item_in_position4 = text.object_blue.currentitem; } ] / ontrialend = [ if (values.h2 == 40% && values.v2 == 25%) { values.item_in_position1 = text.object_green.currentitem; } else if (values.h2 == 60% && values.v2 == 25%) { values.item_in_position2 = text.object_green.currentitem; } else if (values.h2 == 40% && values.v2 == 75%) { values.item_in_position3 = text.object_green.currentitem; } else if (values.h2 == 60% && values.v2 == 75%) { values.item_in_position4 = text.object_green.currentitem; } ] / ontrialend = [ if (values.h3 == 40% && values.v3 == 25%) { values.item_in_position1 = text.object_red.currentitem; } else if (values.h3 == 60% && values.v3 == 25%) { values.item_in_position2 = text.object_red.currentitem; } else if (values.h3 == 40% && values.v3 == 75%) { values.item_in_position3 = text.object_red.currentitem; } else if (values.h3 == 60% && values.v3 == 75%) { values.item_in_position4 = text.object_red.currentitem; } ] / ontrialend = [ if (values.h4 == 40% && values.v4 == 25%) { values.item_in_position1 = text.object_yellow.currentitem; } else if (values.h4 == 60% && values.v4 == 25%) { values.item_in_position2 = text.object_yellow.currentitem; } else if (values.h4 == 40% && values.v4 == 75%) { values.item_in_position3 = text.object_yellow.currentitem; } else if (values.h4 == 60% && values.v4 == 75%) { values.item_in_position4 = text.object_yellow.currentitem; } ]/ stimulustimes = [0=object_blue, object_green, object_red, object_yellow] / validresponse = (object_blue, object_green, object_red, object_yellow) / inputdevice = mouse </trial> <block myblock> / trials = [1-4 = example] </block> <data> / columns = (date time subject group blocknum blockcode trialnum trialcode response latency correct values.item_in_position1 values.item_in_position2 values.item_in_position3 values.item_in_position4) </data> So sorry I didn't see this earlier, thank you so much though, it is very helpful!
|