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


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: 12K, Visits: 98K
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.

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



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: 12K, Visits: 98K
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.

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



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: 12K, Visits: 98K
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>
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 - 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
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: 12K, Visits: 98K
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.

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


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: 12K, Visits: 98K
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.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search