showing randomly paired stimuli again in a second round in the same combination


showing randomly paired stimuli again in a second round in the same...
Author
Message
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: 85K
lir1995 - 3/17/2021
Dave - 3/17/2021
lir1995 - 3/16/2021
Hi, I was hoping to adapt the code you provided in this forum to fit the needs of my experiment (in inquisit 6). I too would like to present participants with a random item and image pairing, and then later present them with the same pairing for a test. 

The difference is that I have a set of images that I want to present randomly for each participant. I am able to do this using the values and counter functions, as I also want to repeat the images multiple times within a block (switching back and forth between two images for multiple trials).

The trouble I am having is making sure the item and image are paired together and then shown on the screen together during the test portion (labeled as source in my code below). Given that each image is in it's own picture element, I am unsure what item to put in the "stimulustimes" for the source block to show participants the correct image that was paired with the word.

*************************************************
Creating Text and Picture Stimuli
***********************************************



<text pracnoun>
/ items = pracnoun
/select = noreplacenorepeat
/ position = (50,50)
/ fontstyle = ("Arial", 25pt)
/ erase = false
/select = values.shownword_item
</text>


<item pracnoun>
/ 1 = "SCOOTER"
/ 2 = "CUPCAKE"
/ 3 = "TRUMPET"
/ 4 = "ZEBRA"
/5 = "NOTEBOOK"
/6 = "LILY"
</item>


<item scenes>
/1 = "bedroom.jpg"
/2 = "library_aisle10.jpg"
/3 = "office.jpg"
/4 = "dentist1.jpg"
</item>

<picture scene1>
/ items = scenes
/select = values.pairedscene_item
</picture>

<values>
/ shownword_item = 1
/ pairedscene_item = 1
</values>

<list word>
/ poolsize = 4
</list>

<list scene>
/ poolsize = 4
</list>


<list word2>
</list>

<list scene2>
/ selectionmode = list.word2.currentindex
</list>


<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
</values>

<picture p1>
/ items = scenes
/ select = values.p1
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p2>
/ items = scenes
/ select = values.p2
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p3>
/ items = scenes
/ select = values.p3
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p4>
/ items = scenes
/ select = values.p4
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>


<counter items>
/ select = noreplace(1-4)
/ selectionrate = always
/ resetinterval = 0
</counter>


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>


<text belong>
/ items = ("Yes")
/ position = (70%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


<text nobelong>
/ items = ("No")
/ position = (30%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


*************************************************
Creating Trials
*************************************************

<trial practice>
/ stimulustimes = [0 =p1; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
  list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ stimulustimes = [0 =p2; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
    values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
  list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ stimulustimes = [0 =p3; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ stimulustimes = [0 =p4; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


*************************************************
Creating Blocks
*************************************************

<block practice>
/ onblockbegin = [values.p1=counter.items.selectedvalue; values.p2=counter.items.selectedvalue]
/ trials = [1-2 = practice; 3-4 = practice2; 5-6 = practice]
</block>


<block mid_same>
/ onblockbegin = [values.p3=counter.items.selectedvalue; values.p4=counter.items.selectedvalue]
/ trials = [1-4 = image3; 5-8 = image4; 9-12 = image3; 13-16 = image4]
</block>

<trial source>
/ ontrialbegin = [values.shownword_item=list.word2.nextvalue; values.pairedscene_item=list.scene2.nextvalue;]
/ stimulustimes = [0 =scene1, pracnoun]
/ validresponse = ("m", "n")
/ posttrialpause = 500
/ timeout = 5000
/ beginresponsetime = 0
</trial>


<block source_mem>
/ trials = [1-6 = source]

</block>


<expt >
/ blocks = [1 = practice; 2 = source_mem
]
</expt>

> Given that each image is in it's own picture element

Is there a specific reason you set it up that way to begin with? If so, what is that reason?

Thanks for asking. The reason is 2 fold (and I'll use this block as an example) 

<block mid_same>
/ onblockbegin = [values.p3=counter.items.selectedvalue; values.p4=counter.items.selectedvalue]
/ trials = [1-4 = image3; 5-8 = image4; 9-12 = image3; 13-16 = image4]
</block>

1) I need it so that participants are switching back and forth between the same two images (so both image 3's are the same image despite switching to a new image in between) 
2) ideally it would be nice that the images are also randomized such that any two images have a random likelihood of occurring in the mid_same condition. I want this to occur so that any effects I see are based on the condition and not the images shown.

However, if there is a better way to do this that would be greatly appreciated!




Okay, but these are *trials* you're switching back and forth between. That does not necessitate separate *picture* elements. You can do

<picture p>
/ items = scenes
/ select = values.itemnumber
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

with

<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
/ itemnumber = 1
</values>

and then

<trial practice>
/ ontrialbegin = [
    values.itemnumber = values.p1;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ ontrialbegin = [
    values.itemnumber = values.p2;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
  values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ ontrialbegin = [
    values.itemnumber = values.p3;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ ontrialbegin = [
    values.itemnumber = values.p4;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>
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: 85K
Dave - 3/17/2021
lir1995 - 3/17/2021
Dave - 3/17/2021
lir1995 - 3/16/2021
Hi, I was hoping to adapt the code you provided in this forum to fit the needs of my experiment (in inquisit 6). I too would like to present participants with a random item and image pairing, and then later present them with the same pairing for a test. 

The difference is that I have a set of images that I want to present randomly for each participant. I am able to do this using the values and counter functions, as I also want to repeat the images multiple times within a block (switching back and forth between two images for multiple trials).

The trouble I am having is making sure the item and image are paired together and then shown on the screen together during the test portion (labeled as source in my code below). Given that each image is in it's own picture element, I am unsure what item to put in the "stimulustimes" for the source block to show participants the correct image that was paired with the word.

*************************************************
Creating Text and Picture Stimuli
***********************************************



<text pracnoun>
/ items = pracnoun
/select = noreplacenorepeat
/ position = (50,50)
/ fontstyle = ("Arial", 25pt)
/ erase = false
/select = values.shownword_item
</text>


<item pracnoun>
/ 1 = "SCOOTER"
/ 2 = "CUPCAKE"
/ 3 = "TRUMPET"
/ 4 = "ZEBRA"
/5 = "NOTEBOOK"
/6 = "LILY"
</item>


<item scenes>
/1 = "bedroom.jpg"
/2 = "library_aisle10.jpg"
/3 = "office.jpg"
/4 = "dentist1.jpg"
</item>

<picture scene1>
/ items = scenes
/select = values.pairedscene_item
</picture>

<values>
/ shownword_item = 1
/ pairedscene_item = 1
</values>

<list word>
/ poolsize = 4
</list>

<list scene>
/ poolsize = 4
</list>


<list word2>
</list>

<list scene2>
/ selectionmode = list.word2.currentindex
</list>


<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
</values>

<picture p1>
/ items = scenes
/ select = values.p1
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p2>
/ items = scenes
/ select = values.p2
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p3>
/ items = scenes
/ select = values.p3
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p4>
/ items = scenes
/ select = values.p4
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>


<counter items>
/ select = noreplace(1-4)
/ selectionrate = always
/ resetinterval = 0
</counter>


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>


<text belong>
/ items = ("Yes")
/ position = (70%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


<text nobelong>
/ items = ("No")
/ position = (30%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


*************************************************
Creating Trials
*************************************************

<trial practice>
/ stimulustimes = [0 =p1; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
  list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ stimulustimes = [0 =p2; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
    values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
  list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ stimulustimes = [0 =p3; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ stimulustimes = [0 =p4; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


*************************************************
Creating Blocks
*************************************************

<block practice>
/ onblockbegin = [values.p1=counter.items.selectedvalue; values.p2=counter.items.selectedvalue]
/ trials = [1-2 = practice; 3-4 = practice2; 5-6 = practice]
</block>


<block mid_same>
/ onblockbegin = [values.p3=counter.items.selectedvalue; values.p4=counter.items.selectedvalue]
/ trials = [1-4 = image3; 5-8 = image4; 9-12 = image3; 13-16 = image4]
</block>

<trial source>
/ ontrialbegin = [values.shownword_item=list.word2.nextvalue; values.pairedscene_item=list.scene2.nextvalue;]
/ stimulustimes = [0 =scene1, pracnoun]
/ validresponse = ("m", "n")
/ posttrialpause = 500
/ timeout = 5000
/ beginresponsetime = 0
</trial>


<block source_mem>
/ trials = [1-6 = source]

</block>


<expt >
/ blocks = [1 = practice; 2 = source_mem
]
</expt>

> Given that each image is in it's own picture element

Is there a specific reason you set it up that way to begin with? If so, what is that reason?

Thanks for asking. The reason is 2 fold (and I'll use this block as an example) 

<block mid_same>
/ onblockbegin = [values.p3=counter.items.selectedvalue; values.p4=counter.items.selectedvalue]
/ trials = [1-4 = image3; 5-8 = image4; 9-12 = image3; 13-16 = image4]
</block>

1) I need it so that participants are switching back and forth between the same two images (so both image 3's are the same image despite switching to a new image in between) 
2) ideally it would be nice that the images are also randomized such that any two images have a random likelihood of occurring in the mid_same condition. I want this to occur so that any effects I see are based on the condition and not the images shown.

However, if there is a better way to do this that would be greatly appreciated!




Okay, but these are *trials* you're switching back and forth between. That does not necessitate separate *picture* elements. You can do

<picture p>
/ items = scenes
/ select = values.itemnumber
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

with

<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
/ itemnumber = 1
</values>

and then

<trial practice>
/ ontrialbegin = [
    values.itemnumber = values.p1;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ ontrialbegin = [
    values.itemnumber = values.p2;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
  values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ ontrialbegin = [
    values.itemnumber = values.p3;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ ontrialbegin = [
    values.itemnumber = values.p4;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>

There's a bunch of stuff in the code you posted that does not make sense to me (i.e. I have no idea why it's there to begin with), but as far as randomly pairing things and ensuring the pairs remain intact goes, see below:

*************************************************
Creating Text and Picture Stimuli
***********************************************
<text pracnoun>
/ items = pracnoun
/ select = values.noun_itemnumber
/ position = (50,50)
/ fontstyle = ("Arial", 25pt)
/ erase = false
</text>

<list noun_items>
/ poolsize = 6
</list>

<item pracnoun>
/ 1 = "SCOOTER"
/ 2 = "CUPCAKE"
/ 3 = "TRUMPET"
/ 4 = "ZEBRA"
/ 5 = "NOTEBOOK"
/ 6 = "LILY"
</item>

<item scenes>
/1 = "bedroom.jpg"
/2 = "library_aisle10.jpg"
/3 = "office.jpg"
/4 = "dentist1.jpg"
</item>

<list word>
</list>

<list scene>
/ selectionmode = list.word.currentindex
</list>

<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
/ pic_itemnumber = 1
/ noun_itemnumber = 1
</values>

<picture p>
/ items = scenes
/ select = values.pic_itemnumber
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<list pic_items>
/ poolsize = 4
/ selectionrate = always
/ resetinterval = 0
</list>

<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>


<text belong>
/ items = ("Yes")
/ position = (70%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


<text nobelong>
/ items = ("No")
/ position = (30%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


*************************************************
Creating Trials
*************************************************

<trial practice>
/ ontrialbegin = [
    values.pic_itemnumber = values.p1;
    values.noun_itemnumber = list.noun_items.nextindex;
    list.scene.appenditem(values.pic_itemnumber);
    list.word.appenditem(values.noun_itemnumber);
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial practice2>
/ ontrialbegin = [
    values.pic_itemnumber = values.p2;
    values.noun_itemnumber = list.noun_items.nextindex;
    list.scene.appenditem(values.pic_itemnumber);
    list.word.appenditem(values.noun_itemnumber);
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image3>
/ ontrialbegin = [
    values.pic_itemnumber = values.p3;
    values.noun_itemnumber = list.noun_items.nextindex;
    list.scene.appenditem(values.pic_itemnumber);
    list.word.appenditem(values.noun_itemnumber);
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ ontrialbegin = [
    values.pic_itemnumber = values.p4;
    values.noun_itemnumber = list.noun_items.nextindex;
    list.scene.appenditem(values.pic_itemnumber);
    list.word.appenditem(values.noun_itemnumber);
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


*************************************************
Creating Blocks
*************************************************

<block practice>
/ onblockbegin = [values.p1=list.pic_items.nextindex; values.p2=list.pic_items.nextindex;]
/ trials = [1-2 = practice; 3-4 = practice2; 5-6 = practice]
</block>


<block mid_same>
/ onblockbegin = [values.p3=list.pic_items.nextindex; values.p4=list.pic_items.nextindex;]
/ trials = [1-4 = image3; 5-8 = image4; 9-12 = image3; 13-16 = image4]
</block>

<trial source>
/ ontrialbegin = [values.noun_itemnumber=list.word.nextvalue; values.pic_itemnumber=list.scene.nextvalue;]
/ stimulustimes = [0 =p, pracnoun]
/ validresponse = ("m", "n")
/ posttrialpause = 500
/ timeout = 5000
/ beginresponsetime = 0
</trial>

<block source_mem>
/ trials = [1-6 = source]
</block>

<expt >
/ blocks = [1 = practice; 2 = source_mem;
]
</expt>

lir1995
lir1995
Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)
Group: Forum Members
Posts: 38, Visits: 187
Dave - 3/17/2021
lir1995 - 3/17/2021
Dave - 3/17/2021
lir1995 - 3/16/2021
Hi, I was hoping to adapt the code you provided in this forum to fit the needs of my experiment (in inquisit 6). I too would like to present participants with a random item and image pairing, and then later present them with the same pairing for a test. 

The difference is that I have a set of images that I want to present randomly for each participant. I am able to do this using the values and counter functions, as I also want to repeat the images multiple times within a block (switching back and forth between two images for multiple trials).

The trouble I am having is making sure the item and image are paired together and then shown on the screen together during the test portion (labeled as source in my code below). Given that each image is in it's own picture element, I am unsure what item to put in the "stimulustimes" for the source block to show participants the correct image that was paired with the word.

*************************************************
Creating Text and Picture Stimuli
***********************************************



<text pracnoun>
/ items = pracnoun
/select = noreplacenorepeat
/ position = (50,50)
/ fontstyle = ("Arial", 25pt)
/ erase = false
/select = values.shownword_item
</text>


<item pracnoun>
/ 1 = "SCOOTER"
/ 2 = "CUPCAKE"
/ 3 = "TRUMPET"
/ 4 = "ZEBRA"
/5 = "NOTEBOOK"
/6 = "LILY"
</item>


<item scenes>
/1 = "bedroom.jpg"
/2 = "library_aisle10.jpg"
/3 = "office.jpg"
/4 = "dentist1.jpg"
</item>

<picture scene1>
/ items = scenes
/select = values.pairedscene_item
</picture>

<values>
/ shownword_item = 1
/ pairedscene_item = 1
</values>

<list word>
/ poolsize = 4
</list>

<list scene>
/ poolsize = 4
</list>


<list word2>
</list>

<list scene2>
/ selectionmode = list.word2.currentindex
</list>


<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
</values>

<picture p1>
/ items = scenes
/ select = values.p1
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p2>
/ items = scenes
/ select = values.p2
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p3>
/ items = scenes
/ select = values.p3
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p4>
/ items = scenes
/ select = values.p4
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>


<counter items>
/ select = noreplace(1-4)
/ selectionrate = always
/ resetinterval = 0
</counter>


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>


<text belong>
/ items = ("Yes")
/ position = (70%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


<text nobelong>
/ items = ("No")
/ position = (30%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


*************************************************
Creating Trials
*************************************************

<trial practice>
/ stimulustimes = [0 =p1; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
  list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ stimulustimes = [0 =p2; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
    values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
  list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ stimulustimes = [0 =p3; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ stimulustimes = [0 =p4; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


*************************************************
Creating Blocks
*************************************************

<block practice>
/ onblockbegin = [values.p1=counter.items.selectedvalue; values.p2=counter.items.selectedvalue]
/ trials = [1-2 = practice; 3-4 = practice2; 5-6 = practice]
</block>


<block mid_same>
/ onblockbegin = [values.p3=counter.items.selectedvalue; values.p4=counter.items.selectedvalue]
/ trials = [1-4 = image3; 5-8 = image4; 9-12 = image3; 13-16 = image4]
</block>

<trial source>
/ ontrialbegin = [values.shownword_item=list.word2.nextvalue; values.pairedscene_item=list.scene2.nextvalue;]
/ stimulustimes = [0 =scene1, pracnoun]
/ validresponse = ("m", "n")
/ posttrialpause = 500
/ timeout = 5000
/ beginresponsetime = 0
</trial>


<block source_mem>
/ trials = [1-6 = source]

</block>


<expt >
/ blocks = [1 = practice; 2 = source_mem
]
</expt>

> Given that each image is in it's own picture element

Is there a specific reason you set it up that way to begin with? If so, what is that reason?

Thanks for asking. The reason is 2 fold (and I'll use this block as an example) 

<block mid_same>
/ onblockbegin = [values.p3=counter.items.selectedvalue; values.p4=counter.items.selectedvalue]
/ trials = [1-4 = image3; 5-8 = image4; 9-12 = image3; 13-16 = image4]
</block>

1) I need it so that participants are switching back and forth between the same two images (so both image 3's are the same image despite switching to a new image in between) 
2) ideally it would be nice that the images are also randomized such that any two images have a random likelihood of occurring in the mid_same condition. I want this to occur so that any effects I see are based on the condition and not the images shown.

However, if there is a better way to do this that would be greatly appreciated!




Okay, but these are *trials* you're switching back and forth between. That does not necessitate separate *picture* elements. You can do

<picture p>
/ items = scenes
/ select = values.itemnumber
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

with

<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
/ itemnumber = 1
</values>

and then

<trial practice>
/ ontrialbegin = [
    values.itemnumber = values.p1;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ ontrialbegin = [
    values.itemnumber = values.p2;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
  values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ ontrialbegin = [
    values.itemnumber = values.p3;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ ontrialbegin = [
    values.itemnumber = values.p4;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>
Thank you so much! That definitely makes sense that I do not need that extra information. Making that change solved my initial issue. When I run my code I am now able to repeat word-image pairs that were randomly shown initially. 

However, a few new problems emerged that I did not have previously when having several picture elements. 

1) the largest issue is that I am now unable to get scene images to repeat within a block. I need the block to look like: p1 p1, p2 p2, p1 p1 ... However, when I run my task with this new implementation, it changes images every time. I've struggled with this for a bit and can't seem to find a solution, so any guidance is much appreciated! The reason I had separately picture elements initially was modeled off of this forum response (https://www.millisecond.com/forums/PrintTopic6259.aspx), which is of course quite old by now. 

2) Additionally, it is only sampling from the first four images, rather than from the whole list. I presume I have an error in my code somewhere.

Thank you again!!


<text pracnoun>
/ items = pracnoun
/select = noreplacenorepeat
/ position = (50,50)
/ fontstyle = ("Arial", 25pt)
/ erase = false
/select = values.shownword_item
</text>


<item pracnoun>
/ 1 = "SCOOTER"
/ 2 = "CUPCAKE"
/ 3 = "TRUMPET"
/ 4 = "ZEBRA"
/5 = "NOTEBOOK"
/6 = "LILY"
</item>


<item scenes>
/1 = "bedroom.jpg"
/2 = "library_aisle10.jpg"
/3 = "office.jpg"
/4 = "dentist1.jpg"
/5 = "track.jpg"
/6 = "trees.jpg"
/7 = "sunset.jpg"
/8 = "airplanecabin1.jpg"
/9 = "amusement4.jpg"
/10 = "appleorchard2.jpg"
/11 = "artstudio3.jpg"
/12 = "backyard6.jpg"
/13 = "bakery1.jpg"
/14 = "barbershop3.jpg"
/15 = "baseball6.jpg"
/16 = "boardwalk.jpg"
/17 = "botanicalGarden5.jpg"
/18 = "bus_shelter3.jpg"
/19 = "skislope7.jpg"
/20 = "citystreet9.jpg"
/21 = "closet7.jpg"
/22 = "conference2.jpg"
/23 = "lab.jpg"
/24 = "bathroom.jpg"
/25 = "gym.jpg"
/26 = "kitchen.jpg"
/27 = "campsite7.jpg"
/28 = "campusquad2.jpg"
/29= "driveway7.jpg"
/30 = "farm3.jpg"
</item>

<picture scene1>
/ items = scenes
</picture>



<picture p>
/ items = scenes
/ select = values.itemnumber
/ position = (50%, 50%)
/ size = (60%, 60%)
/select = values.pairedscene_item
/ selectionrate = always
/ resetinterval = 0
</picture>


<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
/ itemnumber = 1
/ shownword_item = 1
/pairedscene_item = 1
</values>


<counter items>
/ select = noreplace(1-4)
/ selectionrate = always
/ resetinterval = 0
</counter>


<list word>
/ poolsize = 6

</list>

<list scene>
/ poolsize = 6

</list>


<list word2>
</list>

<list scene2>
/ selectionmode = list.word2.currentindex
</list>

<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>


<text belong>
/ items = ("Yes")
/ position = (70%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


<text nobelong>
/ items = ("No")
/ position = (30%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>




<trial practice>
/ ontrialbegin = [
  values.itemnumber = values.p1;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ ontrialbegin = [
  values.itemnumber = values.p2;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ ontrialbegin = [
  values.itemnumber = values.p3;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ ontrialbegin = [
  values.itemnumber = values.p4;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>




<block practice>
/ onblockbegin = [values.itemnumber = values.p1;values.itemnumber = values.p2;]
/ trials = [1-2 = practice; 3-4 = practice2; 5-6 = practice]
</block>



<trial source>
/ ontrialbegin = [values.shownword_item=list.word2.nextvalue; values.pairedscene_item=list.scene2.nextvalue;]
/ stimulustimes = [0 =p, pracnoun]
/ validresponse = ("m", "n")
/ posttrialpause = 500
/ timeout = 5000
/ beginresponsetime = 0
</trial>


<block source_mem>
/ trials = [1-6 = source]

</block>


<expt >
/ blocks = [1 = practice; 2 = source_mem
]

</expt>
lir1995
lir1995
Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)
Group: Forum Members
Posts: 38, Visits: 187
lir1995 - 3/17/2021
Dave - 3/17/2021
lir1995 - 3/17/2021
Dave - 3/17/2021
lir1995 - 3/16/2021
Hi, I was hoping to adapt the code you provided in this forum to fit the needs of my experiment (in inquisit 6). I too would like to present participants with a random item and image pairing, and then later present them with the same pairing for a test. 

The difference is that I have a set of images that I want to present randomly for each participant. I am able to do this using the values and counter functions, as I also want to repeat the images multiple times within a block (switching back and forth between two images for multiple trials).

The trouble I am having is making sure the item and image are paired together and then shown on the screen together during the test portion (labeled as source in my code below). Given that each image is in it's own picture element, I am unsure what item to put in the "stimulustimes" for the source block to show participants the correct image that was paired with the word.

*************************************************
Creating Text and Picture Stimuli
***********************************************



<text pracnoun>
/ items = pracnoun
/select = noreplacenorepeat
/ position = (50,50)
/ fontstyle = ("Arial", 25pt)
/ erase = false
/select = values.shownword_item
</text>


<item pracnoun>
/ 1 = "SCOOTER"
/ 2 = "CUPCAKE"
/ 3 = "TRUMPET"
/ 4 = "ZEBRA"
/5 = "NOTEBOOK"
/6 = "LILY"
</item>


<item scenes>
/1 = "bedroom.jpg"
/2 = "library_aisle10.jpg"
/3 = "office.jpg"
/4 = "dentist1.jpg"
</item>

<picture scene1>
/ items = scenes
/select = values.pairedscene_item
</picture>

<values>
/ shownword_item = 1
/ pairedscene_item = 1
</values>

<list word>
/ poolsize = 4
</list>

<list scene>
/ poolsize = 4
</list>


<list word2>
</list>

<list scene2>
/ selectionmode = list.word2.currentindex
</list>


<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
</values>

<picture p1>
/ items = scenes
/ select = values.p1
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p2>
/ items = scenes
/ select = values.p2
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p3>
/ items = scenes
/ select = values.p3
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p4>
/ items = scenes
/ select = values.p4
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>


<counter items>
/ select = noreplace(1-4)
/ selectionrate = always
/ resetinterval = 0
</counter>


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>


<text belong>
/ items = ("Yes")
/ position = (70%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


<text nobelong>
/ items = ("No")
/ position = (30%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


*************************************************
Creating Trials
*************************************************

<trial practice>
/ stimulustimes = [0 =p1; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
  list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ stimulustimes = [0 =p2; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
    values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
  list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ stimulustimes = [0 =p3; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ stimulustimes = [0 =p4; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


*************************************************
Creating Blocks
*************************************************

<block practice>
/ onblockbegin = [values.p1=counter.items.selectedvalue; values.p2=counter.items.selectedvalue]
/ trials = [1-2 = practice; 3-4 = practice2; 5-6 = practice]
</block>


<block mid_same>
/ onblockbegin = [values.p3=counter.items.selectedvalue; values.p4=counter.items.selectedvalue]
/ trials = [1-4 = image3; 5-8 = image4; 9-12 = image3; 13-16 = image4]
</block>

<trial source>
/ ontrialbegin = [values.shownword_item=list.word2.nextvalue; values.pairedscene_item=list.scene2.nextvalue;]
/ stimulustimes = [0 =scene1, pracnoun]
/ validresponse = ("m", "n")
/ posttrialpause = 500
/ timeout = 5000
/ beginresponsetime = 0
</trial>


<block source_mem>
/ trials = [1-6 = source]

</block>


<expt >
/ blocks = [1 = practice; 2 = source_mem
]
</expt>

> Given that each image is in it's own picture element

Is there a specific reason you set it up that way to begin with? If so, what is that reason?

Thanks for asking. The reason is 2 fold (and I'll use this block as an example) 

<block mid_same>
/ onblockbegin = [values.p3=counter.items.selectedvalue; values.p4=counter.items.selectedvalue]
/ trials = [1-4 = image3; 5-8 = image4; 9-12 = image3; 13-16 = image4]
</block>

1) I need it so that participants are switching back and forth between the same two images (so both image 3's are the same image despite switching to a new image in between) 
2) ideally it would be nice that the images are also randomized such that any two images have a random likelihood of occurring in the mid_same condition. I want this to occur so that any effects I see are based on the condition and not the images shown.

However, if there is a better way to do this that would be greatly appreciated!




Okay, but these are *trials* you're switching back and forth between. That does not necessitate separate *picture* elements. You can do

<picture p>
/ items = scenes
/ select = values.itemnumber
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

with

<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
/ itemnumber = 1
</values>

and then

<trial practice>
/ ontrialbegin = [
    values.itemnumber = values.p1;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ ontrialbegin = [
    values.itemnumber = values.p2;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
  values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ ontrialbegin = [
    values.itemnumber = values.p3;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ ontrialbegin = [
    values.itemnumber = values.p4;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>
Thank you so much! That definitely makes sense that I do not need that extra information. Making that change solved my initial issue. When I run my code I am now able to repeat word-image pairs that were randomly shown initially. 

However, a few new problems emerged that I did not have previously when having several picture elements. 

1) the largest issue is that I am now unable to get scene images to repeat within a block. I need the block to look like: p1 p1, p2 p2, p1 p1 ... However, when I run my task with this new implementation, it changes images every time. I've struggled with this for a bit and can't seem to find a solution, so any guidance is much appreciated! The reason I had separately picture elements initially was modeled off of this forum response (https://www.millisecond.com/forums/PrintTopic6259.aspx), which is of course quite old by now. 

2) Additionally, it is only sampling from the first four images, rather than from the whole list. I presume I have an error in my code somewhere.

Thank you again!!


<text pracnoun>
/ items = pracnoun
/select = noreplacenorepeat
/ position = (50,50)
/ fontstyle = ("Arial", 25pt)
/ erase = false
/select = values.shownword_item
</text>


<item pracnoun>
/ 1 = "SCOOTER"
/ 2 = "CUPCAKE"
/ 3 = "TRUMPET"
/ 4 = "ZEBRA"
/5 = "NOTEBOOK"
/6 = "LILY"
</item>


<item scenes>
/1 = "bedroom.jpg"
/2 = "library_aisle10.jpg"
/3 = "office.jpg"
/4 = "dentist1.jpg"
/5 = "track.jpg"
/6 = "trees.jpg"
/7 = "sunset.jpg"
/8 = "airplanecabin1.jpg"
/9 = "amusement4.jpg"
/10 = "appleorchard2.jpg"
/11 = "artstudio3.jpg"
/12 = "backyard6.jpg"
/13 = "bakery1.jpg"
/14 = "barbershop3.jpg"
/15 = "baseball6.jpg"
/16 = "boardwalk.jpg"
/17 = "botanicalGarden5.jpg"
/18 = "bus_shelter3.jpg"
/19 = "skislope7.jpg"
/20 = "citystreet9.jpg"
/21 = "closet7.jpg"
/22 = "conference2.jpg"
/23 = "lab.jpg"
/24 = "bathroom.jpg"
/25 = "gym.jpg"
/26 = "kitchen.jpg"
/27 = "campsite7.jpg"
/28 = "campusquad2.jpg"
/29= "driveway7.jpg"
/30 = "farm3.jpg"
</item>

<picture scene1>
/ items = scenes
</picture>



<picture p>
/ items = scenes
/ select = values.itemnumber
/ position = (50%, 50%)
/ size = (60%, 60%)
/select = values.pairedscene_item
/ selectionrate = always
/ resetinterval = 0
</picture>


<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
/ itemnumber = 1
/ shownword_item = 1
/pairedscene_item = 1
</values>


<counter items>
/ select = noreplace(1-4)
/ selectionrate = always
/ resetinterval = 0
</counter>


<list word>
/ poolsize = 6

</list>

<list scene>
/ poolsize = 6

</list>


<list word2>
</list>

<list scene2>
/ selectionmode = list.word2.currentindex
</list>

<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>


<text belong>
/ items = ("Yes")
/ position = (70%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


<text nobelong>
/ items = ("No")
/ position = (30%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>




<trial practice>
/ ontrialbegin = [
  values.itemnumber = values.p1;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ ontrialbegin = [
  values.itemnumber = values.p2;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ ontrialbegin = [
  values.itemnumber = values.p3;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ ontrialbegin = [
  values.itemnumber = values.p4;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>




<block practice>
/ onblockbegin = [values.itemnumber = values.p1;values.itemnumber = values.p2;]
/ trials = [1-2 = practice; 3-4 = practice2; 5-6 = practice]
</block>



<trial source>
/ ontrialbegin = [values.shownword_item=list.word2.nextvalue; values.pairedscene_item=list.scene2.nextvalue;]
/ stimulustimes = [0 =p, pracnoun]
/ validresponse = ("m", "n")
/ posttrialpause = 500
/ timeout = 5000
/ beginresponsetime = 0
</trial>


<block source_mem>
/ trials = [1-6 = source]

</block>


<expt >
/ blocks = [1 = practice; 2 = source_mem
]

</expt>

*Edit, I figured out number two is because I need to add more values. Apologies!
lir1995
lir1995
Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)
Group: Forum Members
Posts: 38, Visits: 187
lir1995 - 3/17/2021
lir1995 - 3/17/2021
Dave - 3/17/2021
lir1995 - 3/17/2021
Dave - 3/17/2021
lir1995 - 3/16/2021
Hi, I was hoping to adapt the code you provided in this forum to fit the needs of my experiment (in inquisit 6). I too would like to present participants with a random item and image pairing, and then later present them with the same pairing for a test. 

The difference is that I have a set of images that I want to present randomly for each participant. I am able to do this using the values and counter functions, as I also want to repeat the images multiple times within a block (switching back and forth between two images for multiple trials).

The trouble I am having is making sure the item and image are paired together and then shown on the screen together during the test portion (labeled as source in my code below). Given that each image is in it's own picture element, I am unsure what item to put in the "stimulustimes" for the source block to show participants the correct image that was paired with the word.

*************************************************
Creating Text and Picture Stimuli
***********************************************



<text pracnoun>
/ items = pracnoun
/select = noreplacenorepeat
/ position = (50,50)
/ fontstyle = ("Arial", 25pt)
/ erase = false
/select = values.shownword_item
</text>


<item pracnoun>
/ 1 = "SCOOTER"
/ 2 = "CUPCAKE"
/ 3 = "TRUMPET"
/ 4 = "ZEBRA"
/5 = "NOTEBOOK"
/6 = "LILY"
</item>


<item scenes>
/1 = "bedroom.jpg"
/2 = "library_aisle10.jpg"
/3 = "office.jpg"
/4 = "dentist1.jpg"
</item>

<picture scene1>
/ items = scenes
/select = values.pairedscene_item
</picture>

<values>
/ shownword_item = 1
/ pairedscene_item = 1
</values>

<list word>
/ poolsize = 4
</list>

<list scene>
/ poolsize = 4
</list>


<list word2>
</list>

<list scene2>
/ selectionmode = list.word2.currentindex
</list>


<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
</values>

<picture p1>
/ items = scenes
/ select = values.p1
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p2>
/ items = scenes
/ select = values.p2
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p3>
/ items = scenes
/ select = values.p3
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

<picture p4>
/ items = scenes
/ select = values.p4
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>


<counter items>
/ select = noreplace(1-4)
/ selectionrate = always
/ resetinterval = 0
</counter>


<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>


<text belong>
/ items = ("Yes")
/ position = (70%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


<text nobelong>
/ items = ("No")
/ position = (30%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


*************************************************
Creating Trials
*************************************************

<trial practice>
/ stimulustimes = [0 =p1; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
  list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ stimulustimes = [0 =p2; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
    values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
  list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ stimulustimes = [0 =p3; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ stimulustimes = [0 =p4; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


*************************************************
Creating Blocks
*************************************************

<block practice>
/ onblockbegin = [values.p1=counter.items.selectedvalue; values.p2=counter.items.selectedvalue]
/ trials = [1-2 = practice; 3-4 = practice2; 5-6 = practice]
</block>


<block mid_same>
/ onblockbegin = [values.p3=counter.items.selectedvalue; values.p4=counter.items.selectedvalue]
/ trials = [1-4 = image3; 5-8 = image4; 9-12 = image3; 13-16 = image4]
</block>

<trial source>
/ ontrialbegin = [values.shownword_item=list.word2.nextvalue; values.pairedscene_item=list.scene2.nextvalue;]
/ stimulustimes = [0 =scene1, pracnoun]
/ validresponse = ("m", "n")
/ posttrialpause = 500
/ timeout = 5000
/ beginresponsetime = 0
</trial>


<block source_mem>
/ trials = [1-6 = source]

</block>


<expt >
/ blocks = [1 = practice; 2 = source_mem
]
</expt>

> Given that each image is in it's own picture element

Is there a specific reason you set it up that way to begin with? If so, what is that reason?

Thanks for asking. The reason is 2 fold (and I'll use this block as an example) 

<block mid_same>
/ onblockbegin = [values.p3=counter.items.selectedvalue; values.p4=counter.items.selectedvalue]
/ trials = [1-4 = image3; 5-8 = image4; 9-12 = image3; 13-16 = image4]
</block>

1) I need it so that participants are switching back and forth between the same two images (so both image 3's are the same image despite switching to a new image in between) 
2) ideally it would be nice that the images are also randomized such that any two images have a random likelihood of occurring in the mid_same condition. I want this to occur so that any effects I see are based on the condition and not the images shown.

However, if there is a better way to do this that would be greatly appreciated!




Okay, but these are *trials* you're switching back and forth between. That does not necessitate separate *picture* elements. You can do

<picture p>
/ items = scenes
/ select = values.itemnumber
/ position = (50%, 50%)
/ size = (60%, 60%)
</picture>

with

<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
/ itemnumber = 1
</values>

and then

<trial practice>
/ ontrialbegin = [
    values.itemnumber = values.p1;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ ontrialbegin = [
    values.itemnumber = values.p2;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
  values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ ontrialbegin = [
    values.itemnumber = values.p3;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ ontrialbegin = [
    values.itemnumber = values.p4;
]

/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>
Thank you so much! That definitely makes sense that I do not need that extra information. Making that change solved my initial issue. When I run my code I am now able to repeat word-image pairs that were randomly shown initially. 

However, a few new problems emerged that I did not have previously when having several picture elements. 

1) the largest issue is that I am now unable to get scene images to repeat within a block. I need the block to look like: p1 p1, p2 p2, p1 p1 ... However, when I run my task with this new implementation, it changes images every time. I've struggled with this for a bit and can't seem to find a solution, so any guidance is much appreciated! The reason I had separately picture elements initially was modeled off of this forum response (https://www.millisecond.com/forums/PrintTopic6259.aspx), which is of course quite old by now. 

2) Additionally, it is only sampling from the first four images, rather than from the whole list. I presume I have an error in my code somewhere.

Thank you again!!


<text pracnoun>
/ items = pracnoun
/select = noreplacenorepeat
/ position = (50,50)
/ fontstyle = ("Arial", 25pt)
/ erase = false
/select = values.shownword_item
</text>


<item pracnoun>
/ 1 = "SCOOTER"
/ 2 = "CUPCAKE"
/ 3 = "TRUMPET"
/ 4 = "ZEBRA"
/5 = "NOTEBOOK"
/6 = "LILY"
</item>


<item scenes>
/1 = "bedroom.jpg"
/2 = "library_aisle10.jpg"
/3 = "office.jpg"
/4 = "dentist1.jpg"
/5 = "track.jpg"
/6 = "trees.jpg"
/7 = "sunset.jpg"
/8 = "airplanecabin1.jpg"
/9 = "amusement4.jpg"
/10 = "appleorchard2.jpg"
/11 = "artstudio3.jpg"
/12 = "backyard6.jpg"
/13 = "bakery1.jpg"
/14 = "barbershop3.jpg"
/15 = "baseball6.jpg"
/16 = "boardwalk.jpg"
/17 = "botanicalGarden5.jpg"
/18 = "bus_shelter3.jpg"
/19 = "skislope7.jpg"
/20 = "citystreet9.jpg"
/21 = "closet7.jpg"
/22 = "conference2.jpg"
/23 = "lab.jpg"
/24 = "bathroom.jpg"
/25 = "gym.jpg"
/26 = "kitchen.jpg"
/27 = "campsite7.jpg"
/28 = "campusquad2.jpg"
/29= "driveway7.jpg"
/30 = "farm3.jpg"
</item>

<picture scene1>
/ items = scenes
</picture>



<picture p>
/ items = scenes
/ select = values.itemnumber
/ position = (50%, 50%)
/ size = (60%, 60%)
/select = values.pairedscene_item
/ selectionrate = always
/ resetinterval = 0
</picture>


<values>
/ p1 = 0
/ p2 = 0
/ p3 = 0
/ p4 = 0
/ itemnumber = 1
/ shownword_item = 1
/pairedscene_item = 1
</values>


<counter items>
/ select = noreplace(1-4)
/ selectionrate = always
/ resetinterval = 0
</counter>


<list word>
/ poolsize = 6

</list>

<list scene>
/ poolsize = 6

</list>


<list word2>
</list>

<list scene2>
/ selectionmode = list.word2.currentindex
</list>

<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>


<text belong>
/ items = ("Yes")
/ position = (70%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>


<text nobelong>
/ items = ("No")
/ position = (30%, 80%)
/ size = (30%, 5%)
/ hjustify = center
/ vjustify = center
/ fontstyle = ("Arial", 18pt)
/ txbgcolor = white
/ erase = false
</text>




<trial practice>
/ ontrialbegin = [
  values.itemnumber = values.p1;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial practice2>
/ ontrialbegin = [
  values.itemnumber = values.p2;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
/ ontrialbegin = [
values.shownword_item=list.word.nextindex; values.pairedscene_item=list.scene.nextindex;
list.word2.appenditem(values.shownword_item); list.scene2.appenditem(values.pairedscene_item); ]
</trial>


<trial image3>
/ ontrialbegin = [
  values.itemnumber = values.p3;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>


<trial image4>
/ ontrialbegin = [
  values.itemnumber = values.p4;
]
/ stimulustimes = [0 =p; 1000 = blank; 1500 = pracnoun, belong, nobelong; 4000 = blank]
/ validresponse = ("n","m")
/ posttrialpause = 1000
/ trialduration = 5000
/ responseinterrupt = frames
/ beginresponsetime = 0
/ inputdevice = keyboard
</trial>




<block practice>
/ onblockbegin = [values.itemnumber = values.p1;values.itemnumber = values.p2;]
/ trials = [1-2 = practice; 3-4 = practice2; 5-6 = practice]
</block>



<trial source>
/ ontrialbegin = [values.shownword_item=list.word2.nextvalue; values.pairedscene_item=list.scene2.nextvalue;]
/ stimulustimes = [0 =p, pracnoun]
/ validresponse = ("m", "n")
/ posttrialpause = 500
/ timeout = 5000
/ beginresponsetime = 0
</trial>


<block source_mem>
/ trials = [1-6 = source]

</block>


<expt >
/ blocks = [1 = practice; 2 = source_mem
]

</expt>

*Edit, I figured out number two is because I need to add more values. Apologies!

****Edit******  I apologize I didn't see your second reply, this all works fantastic! Thank you so much. No need to read my previous messages.

Thank you again!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search