Data - recording a randomly generated cues.


Author
Message
mgrimes
mgrimes
Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)
Group: Forum Members
Posts: 14, Visits: 53
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018
Dave - Friday, July 13, 2018
mgrimes - Friday, July 13, 2018
Dave - Thursday, July 12, 2018
mgrimes - Thursday, July 12, 2018
Dave - Wednesday, July 11, 2018
mgrimes - Wednesday, July 11, 2018
Dave - Tuesday, July 10, 2018
mgrimes - Tuesday, July 10, 2018
Hi, 

I am doing an experiment that consists of participants being presented with 4 images, and then an advert appearing for a few m/s and then disappearing. The location and colour of this advert (which is coded as an image) is random. 
I have 2 questions about this. 
1. How can I code the data to show which location and colour was shown to the participant, so I know what they saw, when looking at the collected data? 
2. At the moment, I have coded the positions of the advert by having 4 <picture> elements and their position being defined as shown below:
<picture adverttopleft>
/items = newsign
/select = 1
/ position = (30,45)
/ size = (20%,20%)
</picture>
Is this the best way of doing this, or is there a way to code the image to be positioned randomly in 1 of 4 locations? . 
 I have coded the trials for one colour of advert (see example of trial code below, this is 1 of 10), but I want to add 3 more variations of the colour of the advert. Would it be best to have a trial per colour and then a block that includes the 4 trials (that have each of the four colours of advert)? OR is there a way of randomising the colour and position of the advert within one trial? 

<trial trial1> 
/ontrialbegin = [values.condition = "C1 Raincoat"]
/ontrialbegin = [values.currentsoa = list.SOAS_all.nextvalue]
/ontrialbegin = [values.soa_remaining = values.currentsoa]

/stimulustimes = [1000 = background;
1000 = fixation;
2000 = eraser;
2001 = picture.c1_TL, picture.c1_TR, picture.c1_BL, picture.c1_BR;
2500 = noreplace (picture.advertbottomleft,picture.advertbottomright, picture.adverttopleft,
picture.adverttopright);
2650 = picture.c1_TL, picture.c1_TR, picture.c1_BL, picture.c1_BR;]
/beginresponsetime = (2500+ values.soa_remaining)
/inputdevice=mouse
/validresponse=(picture.c1_TL, picture.c1_TR, picture.c1_BL, picture.c1_BR)
/correctresponse = (picture.advertbottomleft,picture.advertbottomright, picture.adverttopleft,
picture.adverttopright)
/ontrialend = [if (trial.trial1.correct)
{values.countcorrect +=1;
values.sumrt += trial.trial1.latency}]
/ontrialend = [values.x=trial.trial1.responsex;values.y=trial.trial1.responsey]
/recorddata = true


I hope these questions are clear and that someone can help me! 
Many thanks in advance.


> 1. How can I code the data to show which location and colour was shown to the participant, so I know what they saw, when looking at the collected data?

As for the color, you use images. I don't know what color a given image item has, and neither does Inquisit. You would have to derive the color shown from the logged item number that was presented during the given trial.

> Is this the best way of doing this, or is there a way to code the image to be positioned randomly in 1 of 4 locations?

You can achieve random positioning by using <list> elements holding the coordinates for the four positions and the sampling from those at random. I.e.

<values>
/ h = 0%
/ v = 0%
</values>

<picture advert>
/items = newsign
/select = 1
/ hposition = values.h
/ vposition = values.v

/ size = (20%,20%)
</picture>

// the four positions as h / v coordinate pairs
<list hlist>
/ items = (30%, 70%, 30%, 70%)
</list>
<list vlist>
/ items = (45%, 45%, 65%, 65%)
/ selectionmode = list.hlist.currentindex
</list>

<trial trial1> 
/ ontrialbegin = [values.h = list.hlist.nextvalue; values.v = list.vlist.nextvalue;]
/ontrialbegin = [values.condition = "C1 Raincoat"]
/ontrialbegin = [values.currentsoa = list.SOAS_all.nextvalue]
/ontrialbegin = [values.soa_remaining = values.currentsoa]

/stimulustimes = [1000 = background;
1000 = fixation;
2000 = eraser;
2001 = picture.c1_TL, picture.c1_TR, picture.c1_BL, picture.c1_BR;
2500 = picture.advert;
2650 = picture.c1_TL, picture.c1_TR, picture.c1_BL, picture.c1_BR;]
...
</trial>

You can then log values.h and values.v to the data file if need be.

Thank you so much for your response Dave. I think I wasn't clear enough in the first question, what I meant was, if I have coded the image to be selected and shown to the participant randomly from a list, how do I get the data (that is generated once the participant has completed the study) to show which image they were shown? Because the image was chosen at random, at the moment I don't have  a way of seeing what image was shown to the participant. 
This is the code I have for my data at the moment:

<data>
/ separatefiles = true
/ columns = (build, date, time, subject, group, blockcode, trialcode, trialnum, values.countcorrect, values.condition,
values.currentSOA, trialduration, response, correct, latency, values.sumrt, values.x, values.y)
</data>
<summarydata>
/columns = (script.startdate, script.starttime, script.subjectid, script.elapsedtime, computer.platform, values.completed,
expressions.meanrt)
/ separatefiles = true
</summarydata>
<values>
/completed = 0
/currentSOA = 0
/condition = ""
/soa_remaining = 0
/catch_duration = 0
/counttrials = 0
/countcorrect = 0
/sumrt= 0
/x = 0
/y = 0



You either add the appropriate amount of stimulusitem columns to your <data> element's /columns attribute or, if you're going for a single <picture advert> element as exemplified in my previous response, you can simply log the picture.advert.currentitem property to the data file by adding that to /columns.

Thank you so much Dave. 
My final question is regarding trials. I have read that there is no feature to automatically centre the mouse between trials, therefore I have created a trial where the participants must click on a central stimulus to be able to continue. However, at the moment I have 10 trials, which are presented randomly using the noreplace code (see below). I am wondering how I would be able to have a trial where the participant must click in the centre (to centre the mouse), in between each trial, but still have all 10 trials presented once randomly for each participant. 

<trial clicktrial>
/stimulustimes = [0 = continue;
10 = continuebutton]
/beginresponsetime = (10)
/inputdevice = mouse
/ correctresponse = (continuebutton)
</trial>


<block block1>
/trials = [1-10 = noreplace(trial.trial1, trial.trial2, trial.trial3, trial.trial4, trial.trial5, trial.trial6, trial.trial7,
trial.trial8, trial.trial9, trial.trial10)]
/onblockend = [reset(list.soas_all)]
/onblockend = [values.completed = 0; values.countcorrect = 0]
/onblockend = [values.sumrt]
/onblockend = [values.counttrials = 0]
</block>

<expt>
/preinstructions = (intro)
/ blocks = [1=block1]
/postinstructions = (end)
/onexptend = [values.completed = 1]



Several ways:

#1: Just /branch to trial.clicktrial from all the other <trial> elements:

<trial trial1>
...
/ branch = [trial.clicktrial]
</trial>

<trial trial2>
...
/ branch = [trial.clicktrial]
</trial>

#2: If you don't want to use /branch for some reason, you can also simply do:

<block block1>
/trials = [1,3,5,7,9,11,13,15,17,19 = noreplace(trial.trial1, trial.trial2, trial.trial3, trial.trial4, trial.trial5, trial.trial6, trial.trial7,
trial.trial8, trial.trial9, trial.trial10); 2,4,6,8,10,12,14,16,18 = trial.clicktrial]

...
</block>

Thank you Dave, I have put all these suggestions in place and the script is running perfectly. I was also wondering how you record the position of the advert that is shown randomly to the participant, as the code you suggested only shows which advert image was shown, but not the location? 

Many thanks

As I said here https://www.millisecond.com/forums/FindPost25216.aspx , you can log values.h and values.v to the data file by specifying a <data> element in the script with its /columns set up according to your needs.

Thank you Dave. 

I am now wondering if I can randomise the position of my 4 images that the participant is presented with at each of the 10 trials, but also record which image is in each position, when shown to the participant.
I tried to do what you suggested with for randomising the position of the advert, but this did not quite seem to work, the pictures did not go where I wanted and I was only shown one image at a time. (see below for my 2 attempts)
<picture c1>
/items = ("c1r.jpg", "c1y.jpg", "c1b.jpg","c1g.jpg")
/hposition = (25%, 75%, 25%, 75%)
/vposition = (45%, 45%, 75%, 75%)
/size = (35%, 35%)
</picture>

This just showed 1 image at a time.
Then I tried....
 
<list hlist2>
/items = (25%, 75%, 25%, 75%)
</list>

<list vlist2>
/items = (45%, 45%, 75%, 75%)
/selectionmode = list.hlist2.currentindex
</list>

<pictur<list hlist2>
/items = (25%, 75%, 25%, 75%)
</list>

<list vlist2>
/items = (45%, 45%, 75%, 75%)
/selectionmode = list.hlist2.currentindex
</list>
e c2>
/items = targets
/select = replace (5, 6, 7, 8)
/hposition = values.h2
/vposition = values.v2
/size = (35%, 35%)
</picture>
This showed 1 image  in the wrong place. 

Finally, I am also stuck on how to get a stimulus to show at a randomised predefined time. 
I would like to have the advert in my trial to be presented for a randomly chosen length of time. 
I have defined a list of the times:
<list SOAS_all>
/items = (150, 350, 300, 1500)
/replace = false
</list>

And would like the picture.advert to be presented for one of the SOAs listed times. How do I go about this? At the moment the SOAs list of times are inserting randomly at the begin response time but I am unsure how to change this to be at the advert timing, and for the rest of the images to appear afterwards.

<trial trial1>
/ontrialbegin = [values.h1 = list.hlist1.nextvalue; values.v1 = list.vlist1.nextvalue;]
/ontrialbegin = [values.condition = "C1 Raincoat"]
/ontrialbegin = [values.currentsoa = list.SOAS_all.nextvalue]
/ontrialbegin = [values.soa_remaining = values.currentsoa]

/stimulustimes = [1000 = background;
1000 = fixation;
2000 = eraser;
2001 = picture.c1;
2500 = picture.advert;
2650 = picture.c1]
/beginresponsetime = (2500+ values.soa_remaining)
/inputdevice=mouse
/validresponse=(picture.advert)
/ontrialend = [if (trial.trial1.correct)
{values.countcorrect +=1;
values.sumrt += trial.trial1.latency}]
/ontrialend = [values.x=trial.trial1.responsex;values.y=trial.trial1.responsey]
/recorddata = true

Is there a way of doing this simply, or, should I write the code for all the options (e.g. trial 1 written 4 times for each of the different SOAs, and then randomise which trial the participant is shown)? 

Many thanks in advance. 


#1: You need to use <list> elements for your positions.
#2: If you need to sample multiple items from those <list>s within a single <trial>, those lists' /selectionrate needs to be set to always.
#3: Use <values> as demonstrated previously to store the respective h / v positions sampled from the lists /ontrialbegin as demonstrated previously. Log those values to the data file as demonstrated previously.
#4: To insert a stimulus *dynamically* at varying times into the <trial>'s stimulus presentation sequence, you need to make use of the insertstimulustime() function /ontrialbegin, and the resetstimulusframes() function /ontrialend.

Thank 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.
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: 103K
mgrimes - Monday, July 16, 2018

Thank 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.

Edited 6 Years Ago by Dave
mgrimes
mgrimes
Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)
Group: Forum Members
Posts: 14, Visits: 53
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018

Thank 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! 
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: 103K
mgrimes - Monday, July 16, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018

Thank 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.

mgrimes
mgrimes
Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)
Group: Forum Members
Posts: 14, Visits: 53
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018

Thank 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!


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: 103K
mgrimes - Tuesday, July 17, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018

Thank 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.

mgrimes
mgrimes
Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)
Group: Forum Members
Posts: 14, Visits: 53
Dave - Tuesday, July 17, 2018
mgrimes - Tuesday, July 17, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018

Thank 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!
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: 103K
mgrimes - Tuesday, July 17, 2018
Dave - Tuesday, July 17, 2018
mgrimes - Tuesday, July 17, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018

Thank 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>


mgrimes
mgrimes
Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)
Group: Forum Members
Posts: 14, Visits: 53
Dave - Tuesday, July 17, 2018
mgrimes - Tuesday, July 17, 2018
Dave - Tuesday, July 17, 2018
mgrimes - Tuesday, July 17, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018

Thank 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>



Attachments
Position trial.iqx (485 views, 60.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: 103K
mgrimes - Tuesday, July 17, 2018
Dave - Tuesday, July 17, 2018
mgrimes - Tuesday, July 17, 2018
Dave - Tuesday, July 17, 2018
mgrimes - Tuesday, July 17, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018
Dave - Monday, July 16, 2018
mgrimes - Monday, July 16, 2018

Thank 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?


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search