Millisecond Forums

Recognition task

https://forums.millisecond.com/Topic40896.aspx

By nfbecker - 6/19/2025

Hi! Thank you so much again for your previous help! Right now, I'm struggling with another step in my experiment and hope to get your input:

In a first step, I want to randomly select different items using lists and present them one after the other (works nicely now, thank you!).
As a second step, I want to present all of those selected items at the same time. And well, that's where I'm struggeling, as right now other items are presented...

This is the script I have running so far: Text is presented in sequence, with different lists 3 a-items and 3 b-items are selected randomly out of 10 a/b-items,
and they are presented twice each within the block.b_learn.

<item alltexts>
/ 1 = "text1"
/ 2 = "text2"
/ 3 = "text3"
/ 4 = "text4"
/ 5 = "text5"
/ 6 = "text6"
/ 7 = "text7"
/ 8 = "text8"
/ 9 = "text9"
/ 10 = "text10"
/ 11 = "text11"
/ 12 = "text12"
</item>
<text text>
/ items = alltexts
/ position = (50, 10)
/ select = sequence
</text>

<item allpics>
/ 1 = "a01.jpg"
/ 2 = "a02.jpg"
/ 3 = "a03.jpg"
/ 4 = "a04.jpg"
/ 5 = "a05.jpg"
/ 6 = "a06.jpg"
/ 7 = "a07.jpg"
/ 8 = "a08.jpg"
/ 9 = "a09.jpg"
/ 10 = "a10.jpg"
/ 11 = "b01.jpg"
/ 12 = "b02.jpg"
/ 13 = "b03.jpg"
/ 14 = "b04.jpg"
/ 15 = "b05.jpg"
/ 16 = "b06.jpg"
/ 17 = "b07.jpg"
/ 18 = "b08.jpg"
/ 19 = "b09.jpg"
/ 20 = "b10.jpg"
</item>
<text pics>
/ items = allpics
/ position = (50, 50)
/ select = list.selectedItemnumbers.nextvalue
</text>

<list selectedItemnumbers>
</list>
<list aItemnumbers>
/ items = (1-10)
/ selectionRate = always
</list>
<list bItemnumbers>
/ items = (11-20)
/ selectionRate = always
</list>

<trial t_learn>
/ stimulusframes = [1 = text, pics]
/ timeout = 100
</trial>

<block b_learn>
/ onBlockBegin = [
var i = 0;
while (i < 3) {list.selectedItemnumbers.appendItem(list.aItemnumbers.nextValue); i += 1; };
i = 0;
while (i < 3) {list.selectedItemnumbers.appendItem(list.bItemnumbers.nextValue); i += 1;};]
/ trials = [1-12 = t_learn]
/ branch = [block.b_recog]
</block>
(There are different kinds of learning blocks, so I would branch to the relevant recognition block.)


Now I want to show all previously selected and presented items at the same time. And I want to present all of them in the same order over multiple trials.
So I figured, that I have to generate multiple text-elements to present them all (and not just the same one multiple times).
From other forum posts and the test database, I learned, that as the previous lists list.aItemnumbers and list.bItemnumbers select at random,
I have to create a new list, list.sequenceItemnumbers.
At the beginning of the recognition block b_recog, the new list draws from those two a/bItemnumbers to receive the different a/b-Items.
(I tried drawing from the overall selectedItemnumbers, as I thought that all used items would also be stored there and that would facilitate the selection,
but then the same item was presented multiple times.)

<text pic01>
/ items = allpics
/ select = list.sequenceItemnumbers.1
</text>
<text pic02>
/ items = allpics
/ select = list.sequenceItemnumbers.2
</text>
<text pic03>
/ items = allpics
/ select = list.sequenceItemnumbers.3
</text>
<text pic04>
/ items = allpics
/ select = list.sequenceItemnumbers.4
</text>
<text pic05>
/ items = allpics
/ select = list.sequenceItemnumbers.5
</text>
<text pic06>
/ items = allpics
/ select = list.sequenceItemnumbers.6
</text>

<list sequenceItemnumbers>
/ selectionmode = sequence
</list>

Additionally, I define the position of each pic at the beginning of the block through horizontal/vertical positions,
as each image should be presented at the same spot throughout trials.
(I don't do that in the new text-elements, as I draw from the list.a/bItemnumbers not the overall list.selectedItemnumbers.
And then the a/b items would always be with the same order and position.)
And this nicely puts the items throughout the trials at the same spot.

<counter hpositions>
/ items = (25, 35, 45, 55, 65, 75)
/ select = noreplacenorepeat
/ selectionrate = always
</counter>
<counter vpositions>
/ items = (38, 38, 38, 38, 38, 38)
/ select = current(hpositions)
/ selectionrate = always
</counter>

<trial t_recog>
/ inputdevice = mouse
/ stimulusframes = [1 = text, pic01, pic02, pic03, pic04, pic05, pic06]
/ validresponse = ("pic01", "pic02", "pic03", "pic04", "pic05", "pic06")
</trial>

<block b_recog>
/ onblockbegin = [
list.sequenceItemnumbers.appenditem(list.aItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.aItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.aItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.bItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.bItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.bItemnumbers.nextvalue);
text.pic01.hposition = counter.hpositions.selectedvalue;
text.pic01.vposition = counter.vpositions.selectedvalue;
text.pic02.hposition = counter.hpositions.selectedvalue;
text.pic02.vposition = counter.vpositions.selectedvalue;
text.pic03.hposition = counter.hpositions.selectedvalue;
text.pic03.vposition = counter.vpositions.selectedvalue;
text.pic04.hposition = counter.hpositions.selectedvalue;
text.pic04.vposition = counter.vpositions.selectedvalue;
text.pic05.hposition = counter.hpositions.selectedvalue;
text.pic05.vposition = counter.vpositions.selectedvalue;
text.pic06.hposition = counter.hpositions.selectedvalue;
text.pic06.vposition = counter.vpositions.selectedvalue; ]
/ trials = [1-12 = t_recog]
</block>

<expt exp>
/ blocks = [1 = b_learn]
</expt>

But now what does not work: During b_learn and b_recog different items are presented. So the list.sequenceItemnumbers does not use the same items as the list.a/bItemnumbers.
I thought that a list might be resetted after a block, but writing everything in the same block didn't solve it.
And then I tried around with different list settings and onblockbegin comands, but didn't get closer.

Right now I'm a bit lost of where else to check or to read up on.
I guess, someone must have asked and posted something similar, as it seems like a typical problem in recognition tasks,
but I've only found posts regarding (randomized) fixed sequences of items, but when all items are used and have not been selected randomly before.

I would really appreciate your input!

By Dave - 6/19/2025

nfbecker - 6/19/2025
Hi! Thank you so much again for your previous help! Right now, I'm struggling with another step in my experiment and hope to get your input:

In a first step, I want to randomly select different items using lists and present them one after the other (works nicely now, thank you!).
As a second step, I want to present all of those selected items at the same time. And well, that's where I'm struggeling, as right now other items are presented...

This is the script I have running so far: Text is presented in sequence, with different lists 3 a-items and 3 b-items are selected randomly out of 10 a/b-items,
and they are presented twice each within the block.b_learn.

<item alltexts>
/ 1 = "text1"
/ 2 = "text2"
/ 3 = "text3"
/ 4 = "text4"
/ 5 = "text5"
/ 6 = "text6"
/ 7 = "text7"
/ 8 = "text8"
/ 9 = "text9"
/ 10 = "text10"
/ 11 = "text11"
/ 12 = "text12"
</item>
<text text>
/ items = alltexts
/ position = (50, 10)
/ select = sequence
</text>

<item allpics>
/ 1 = "a01.jpg"
/ 2 = "a02.jpg"
/ 3 = "a03.jpg"
/ 4 = "a04.jpg"
/ 5 = "a05.jpg"
/ 6 = "a06.jpg"
/ 7 = "a07.jpg"
/ 8 = "a08.jpg"
/ 9 = "a09.jpg"
/ 10 = "a10.jpg"
/ 11 = "b01.jpg"
/ 12 = "b02.jpg"
/ 13 = "b03.jpg"
/ 14 = "b04.jpg"
/ 15 = "b05.jpg"
/ 16 = "b06.jpg"
/ 17 = "b07.jpg"
/ 18 = "b08.jpg"
/ 19 = "b09.jpg"
/ 20 = "b10.jpg"
</item>
<text pics>
/ items = allpics
/ position = (50, 50)
/ select = list.selectedItemnumbers.nextvalue
</text>

<list selectedItemnumbers>
</list>
<list aItemnumbers>
/ items = (1-10)
/ selectionRate = always
</list>
<list bItemnumbers>
/ items = (11-20)
/ selectionRate = always
</list>

<trial t_learn>
/ stimulusframes = [1 = text, pics]
/ timeout = 100
</trial>

<block b_learn>
/ onBlockBegin = [
var i = 0;
while (i < 3) {list.selectedItemnumbers.appendItem(list.aItemnumbers.nextValue); i += 1; };
i = 0;
while (i < 3) {list.selectedItemnumbers.appendItem(list.bItemnumbers.nextValue); i += 1;};]
/ trials = [1-12 = t_learn]
/ branch = [block.b_recog]
</block>
(There are different kinds of learning blocks, so I would branch to the relevant recognition block.)


Now I want to show all previously selected and presented items at the same time. And I want to present all of them in the same order over multiple trials.
So I figured, that I have to generate multiple text-elements to present them all (and not just the same one multiple times).
From other forum posts and the test database, I learned, that as the previous lists list.aItemnumbers and list.bItemnumbers select at random,
I have to create a new list, list.sequenceItemnumbers.
At the beginning of the recognition block b_recog, the new list draws from those two a/bItemnumbers to receive the different a/b-Items.
(I tried drawing from the overall selectedItemnumbers, as I thought that all used items would also be stored there and that would facilitate the selection,
but then the same item was presented multiple times.)

<text pic01>
/ items = allpics
/ select = list.sequenceItemnumbers.1
</text>
<text pic02>
/ items = allpics
/ select = list.sequenceItemnumbers.2
</text>
<text pic03>
/ items = allpics
/ select = list.sequenceItemnumbers.3
</text>
<text pic04>
/ items = allpics
/ select = list.sequenceItemnumbers.4
</text>
<text pic05>
/ items = allpics
/ select = list.sequenceItemnumbers.5
</text>
<text pic06>
/ items = allpics
/ select = list.sequenceItemnumbers.6
</text>

<list sequenceItemnumbers>
/ selectionmode = sequence
</list>

Additionally, I define the position of each pic at the beginning of the block through horizontal/vertical positions,
as each image should be presented at the same spot throughout trials.
(I don't do that in the new text-elements, as I draw from the list.a/bItemnumbers not the overall list.selectedItemnumbers.
And then the a/b items would always be with the same order and position.)
And this nicely puts the items throughout the trials at the same spot.

<counter hpositions>
/ items = (25, 35, 45, 55, 65, 75)
/ select = noreplacenorepeat
/ selectionrate = always
</counter>
<counter vpositions>
/ items = (38, 38, 38, 38, 38, 38)
/ select = current(hpositions)
/ selectionrate = always
</counter>

<trial t_recog>
/ inputdevice = mouse
/ stimulusframes = [1 = text, pic01, pic02, pic03, pic04, pic05, pic06]
/ validresponse = ("pic01", "pic02", "pic03", "pic04", "pic05", "pic06")
</trial>

<block b_recog>
/ onblockbegin = [
list.sequenceItemnumbers.appenditem(list.aItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.aItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.aItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.bItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.bItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.bItemnumbers.nextvalue);
text.pic01.hposition = counter.hpositions.selectedvalue;
text.pic01.vposition = counter.vpositions.selectedvalue;
text.pic02.hposition = counter.hpositions.selectedvalue;
text.pic02.vposition = counter.vpositions.selectedvalue;
text.pic03.hposition = counter.hpositions.selectedvalue;
text.pic03.vposition = counter.vpositions.selectedvalue;
text.pic04.hposition = counter.hpositions.selectedvalue;
text.pic04.vposition = counter.vpositions.selectedvalue;
text.pic05.hposition = counter.hpositions.selectedvalue;
text.pic05.vposition = counter.vpositions.selectedvalue;
text.pic06.hposition = counter.hpositions.selectedvalue;
text.pic06.vposition = counter.vpositions.selectedvalue; ]
/ trials = [1-12 = t_recog]
</block>

<expt exp>
/ blocks = [1 = b_learn]
</expt>

But now what does not work: During b_learn and b_recog different items are presented. So the list.sequenceItemnumbers does not use the same items as the list.a/bItemnumbers.
I thought that a list might be resetted after a block, but writing everything in the same block didn't solve it.
And then I tried around with different list settings and onblockbegin comands, but didn't get closer.

Right now I'm a bit lost of where else to check or to read up on.
I guess, someone must have asked and posted something similar, as it seems like a typical problem in recognition tasks,
but I've only found posts regarding (randomized) fixed sequences of items, but when all items are used and have not been selected randomly before.

I would really appreciate your input!


(1) list.listname.1 (2, 3, etc,) is not a thing that exists.
(2) Never use <counter> elements. Always use <list>.
(3) The items you selected are in list.selectedItemNumbers. It makes no sense whatsoever to sample new, and entirely different items from list.aItemnumber and list.bItemnubers to place them in list.sequenceItemnumbers. If you want the previously selected and shown items in list.sequenceItemnumbers, then you need to get them from list.selectedItemnubers.
By Dave - 6/19/2025

Dave - 6/19/2025
nfbecker - 6/19/2025
Hi! Thank you so much again for your previous help! Right now, I'm struggling with another step in my experiment and hope to get your input:

In a first step, I want to randomly select different items using lists and present them one after the other (works nicely now, thank you!).
As a second step, I want to present all of those selected items at the same time. And well, that's where I'm struggeling, as right now other items are presented...

This is the script I have running so far: Text is presented in sequence, with different lists 3 a-items and 3 b-items are selected randomly out of 10 a/b-items,
and they are presented twice each within the block.b_learn.

<item alltexts>
/ 1 = "text1"
/ 2 = "text2"
/ 3 = "text3"
/ 4 = "text4"
/ 5 = "text5"
/ 6 = "text6"
/ 7 = "text7"
/ 8 = "text8"
/ 9 = "text9"
/ 10 = "text10"
/ 11 = "text11"
/ 12 = "text12"
</item>
<text text>
/ items = alltexts
/ position = (50, 10)
/ select = sequence
</text>

<item allpics>
/ 1 = "a01.jpg"
/ 2 = "a02.jpg"
/ 3 = "a03.jpg"
/ 4 = "a04.jpg"
/ 5 = "a05.jpg"
/ 6 = "a06.jpg"
/ 7 = "a07.jpg"
/ 8 = "a08.jpg"
/ 9 = "a09.jpg"
/ 10 = "a10.jpg"
/ 11 = "b01.jpg"
/ 12 = "b02.jpg"
/ 13 = "b03.jpg"
/ 14 = "b04.jpg"
/ 15 = "b05.jpg"
/ 16 = "b06.jpg"
/ 17 = "b07.jpg"
/ 18 = "b08.jpg"
/ 19 = "b09.jpg"
/ 20 = "b10.jpg"
</item>
<text pics>
/ items = allpics
/ position = (50, 50)
/ select = list.selectedItemnumbers.nextvalue
</text>

<list selectedItemnumbers>
</list>
<list aItemnumbers>
/ items = (1-10)
/ selectionRate = always
</list>
<list bItemnumbers>
/ items = (11-20)
/ selectionRate = always
</list>

<trial t_learn>
/ stimulusframes = [1 = text, pics]
/ timeout = 100
</trial>

<block b_learn>
/ onBlockBegin = [
var i = 0;
while (i < 3) {list.selectedItemnumbers.appendItem(list.aItemnumbers.nextValue); i += 1; };
i = 0;
while (i < 3) {list.selectedItemnumbers.appendItem(list.bItemnumbers.nextValue); i += 1;};]
/ trials = [1-12 = t_learn]
/ branch = [block.b_recog]
</block>
(There are different kinds of learning blocks, so I would branch to the relevant recognition block.)


Now I want to show all previously selected and presented items at the same time. And I want to present all of them in the same order over multiple trials.
So I figured, that I have to generate multiple text-elements to present them all (and not just the same one multiple times).
From other forum posts and the test database, I learned, that as the previous lists list.aItemnumbers and list.bItemnumbers select at random,
I have to create a new list, list.sequenceItemnumbers.
At the beginning of the recognition block b_recog, the new list draws from those two a/bItemnumbers to receive the different a/b-Items.
(I tried drawing from the overall selectedItemnumbers, as I thought that all used items would also be stored there and that would facilitate the selection,
but then the same item was presented multiple times.)

<text pic01>
/ items = allpics
/ select = list.sequenceItemnumbers.1
</text>
<text pic02>
/ items = allpics
/ select = list.sequenceItemnumbers.2
</text>
<text pic03>
/ items = allpics
/ select = list.sequenceItemnumbers.3
</text>
<text pic04>
/ items = allpics
/ select = list.sequenceItemnumbers.4
</text>
<text pic05>
/ items = allpics
/ select = list.sequenceItemnumbers.5
</text>
<text pic06>
/ items = allpics
/ select = list.sequenceItemnumbers.6
</text>

<list sequenceItemnumbers>
/ selectionmode = sequence
</list>

Additionally, I define the position of each pic at the beginning of the block through horizontal/vertical positions,
as each image should be presented at the same spot throughout trials.
(I don't do that in the new text-elements, as I draw from the list.a/bItemnumbers not the overall list.selectedItemnumbers.
And then the a/b items would always be with the same order and position.)
And this nicely puts the items throughout the trials at the same spot.

<counter hpositions>
/ items = (25, 35, 45, 55, 65, 75)
/ select = noreplacenorepeat
/ selectionrate = always
</counter>
<counter vpositions>
/ items = (38, 38, 38, 38, 38, 38)
/ select = current(hpositions)
/ selectionrate = always
</counter>

<trial t_recog>
/ inputdevice = mouse
/ stimulusframes = [1 = text, pic01, pic02, pic03, pic04, pic05, pic06]
/ validresponse = ("pic01", "pic02", "pic03", "pic04", "pic05", "pic06")
</trial>

<block b_recog>
/ onblockbegin = [
list.sequenceItemnumbers.appenditem(list.aItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.aItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.aItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.bItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.bItemnumbers.nextvalue);
list.sequenceItemnumbers.appenditem(list.bItemnumbers.nextvalue);
text.pic01.hposition = counter.hpositions.selectedvalue;
text.pic01.vposition = counter.vpositions.selectedvalue;
text.pic02.hposition = counter.hpositions.selectedvalue;
text.pic02.vposition = counter.vpositions.selectedvalue;
text.pic03.hposition = counter.hpositions.selectedvalue;
text.pic03.vposition = counter.vpositions.selectedvalue;
text.pic04.hposition = counter.hpositions.selectedvalue;
text.pic04.vposition = counter.vpositions.selectedvalue;
text.pic05.hposition = counter.hpositions.selectedvalue;
text.pic05.vposition = counter.vpositions.selectedvalue;
text.pic06.hposition = counter.hpositions.selectedvalue;
text.pic06.vposition = counter.vpositions.selectedvalue; ]
/ trials = [1-12 = t_recog]
</block>

<expt exp>
/ blocks = [1 = b_learn]
</expt>

But now what does not work: During b_learn and b_recog different items are presented. So the list.sequenceItemnumbers does not use the same items as the list.a/bItemnumbers.
I thought that a list might be resetted after a block, but writing everything in the same block didn't solve it.
And then I tried around with different list settings and onblockbegin comands, but didn't get closer.

Right now I'm a bit lost of where else to check or to read up on.
I guess, someone must have asked and posted something similar, as it seems like a typical problem in recognition tasks,
but I've only found posts regarding (randomized) fixed sequences of items, but when all items are used and have not been selected randomly before.

I would really appreciate your input!


(1) list.listname.1 (2, 3, etc,) is not a thing that exists.
(2) Never use <counter> elements. Always use <list>.
(3) The items you selected are in list.selectedItemNumbers. It makes no sense whatsoever to sample new, and entirely different items from list.aItemnumber and list.bItemnubers to place them in list.sequenceItemnumbers. If you want the previously selected and shown items in list.sequenceItemnumbers, then you need to get them from list.selectedItemnubers.

Here's a basic sketch:

<expt e>
/ blocks = [1=first; 2=second]
</expt>

<block first>
/ onblockbegin = [
    var i = 0;
    // pick two from A
    while (i < 2) {
        list.selectedItemNumbers.appenditem(list.aItemNumbers.nextValue);
        i += 1;
    };
    i = 0;
    // pick two from B
    while (i < 2) {
        list.selectedItemNumbers.appenditem(list.bItemNumbers.nextValue);
        i += 1;
    }
]
/ trials = [1-4=firstTrial]
</block>

<trial firstTrial>
/ stimulusframes = [1=stim]
/ trialduration = 500
/ validresponse = (0)
</trial>

<list selectedItemNumbers>
</list>

<list aItemNumbers>
/ items = (1-4)
/ selectionrate = always
</list>

<list bItemNumbers>
/ items = (5-8)
/ selectionrate = always
</list>

<item allItems>
// A
/ 1 = "A1"
/ 2 = "A2"
/ 3 = "A3"
/ 4 = "A4"
// B
/ 5 = "B1"
/ 6 = "B2"
/ 7 = "B3"
/ 8 = "B4"
</item>

<text stim>
/ items = allItems
/ select = list.selectedItemNumbers.nextValue
</text>

<block second>
/ onblockbegin = [
    // pick x/y positions for the stimuli
    values.a1x = list.x.nextvalue;
    values.a1y = list.y.nextvalue;
    values.a2x = list.x.nextvalue;
    values.a2y = list.y.nextvalue;
    values.b1x = list.x.nextvalue;
    values.b1y = list.y.nextvalue;
    values.b2x = list.x.nextvalue;
    values.b2y = list.y.nextvalue;
]
/ trials = [1-4 = secondTrial]
</block>

<values>
/ a1x = 0%
/ a1y = 0%
/ a2x = 0%
/ a2y = 0%
/ b1x = 0%
/ b1y = 0%
/ b2x = 0%
/ b2y = 0%
</values>


<list x>
/ items = (40%, 60%, 40%, 60%)
/ selectionrate = always
</list>

<list y>
/ items = (40%, 40%, 60%, 60%)
/ selectionrate = always
/ selectionmode = list.x.currentindex
</list>

<trial secondTrial>
/ stimulusframes = [1=aSelected1, aSelected2, bSelected1, bSelected2]
/ validresponse = (" ")
</trial>

<text aSelected1>
/ items = allItems
/ select = list.selectedItemNumbers.items.1
/ hposition = values.a1x
/ vposition = values.a1y
</text>

<text aSelected2>
/ items = allItems
/ select = list.selectedItemNumbers.items.2
/ hposition = values.a2x
/ vposition = values.a2y
</text>

<text bSelected1>
/ items = allItems
/ select = list.selectedItemNumbers.items.3
/ hposition = values.b1x
/ vposition = values.b1y
</text>

<text bSelected2>
/ items = allItems
/ select = list.selectedItemNumbers.items.4
/ hposition = values.b2x
/ vposition = values.b2y
</text>