Representing stimuli from several lists of items


Author
Message
Aleksandr
Aleksandr
Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)
Group: Forum Members
Posts: 8, Visits: 40
Hi, hope you're doing well!

I've been struggling with representing picture stimuli items from several lists.

I have 4 item elements each consisting of 15 stimuli items (60 in total). I also have another 60 item elements each consisting of 9 stimuli items (540 in total). Thus, overall I have 64 item elements and 600 different stimuli items. 

I want to create a <list SameList> and to put 4 item elements (consisting of 15 stimuli each) in it. I want all the 60 stimuli from this list to be used in the experiment in a random order. The code I wrote for this part:

<list SameList>
/ items = [item.SAMEN; item.SAMENR; item.SAMES; item.SAMESR]
/ poolsize = 60
/ itemprobabilities = uniform
/ selectionmode = random
/ selectionrate = always
/ replace = false
</list>

Then, I create another list <list DifferentList> for another 60 item elements (consisting of 9 stimuli each). I want only 60 stimuli from this pool of 540 stimuli of items to be used in the experiment. I want to make it in a way that only one random stimulus from each of the 60 item elements included in the list is chosen. I wrote it this way:

<list DifferentList>
/ items = [item.D1; ... ; item.D60]
/ poolsize = 60
/ itemprobabilities = uniform
/ selectionmode = random
/ selectionrate = always
/ replace = false
</list>

Lastly, I tried to create a list combining these two lists. I want at the end to have 120 stimuli to be represented (I have 120 trials): all the 60 from the 4 item elements in SameList and 60 stimuli (one random) from each of the 60 item elements in DifferentList. I want these 120 to be shown in a random order. 

<list masterlist>
/ items = [list.SameList; list.DifferentList]
/ poolsize = 120
/ itemprobabilities = [0.5; 0.5]
/ selectionmode = random 
/ selectionrate = always 
/ replace = false
</list>

Then I use Picture element to ask the program to represent the stimuli in line with my idea.
When I use picture element, the program requires either to mention all the 600 stimuli one by one or to refer to the one joint item element. I mention the 600 one by one.

<picture Stimulus>
/ items = ("A1N.jpg"; "A2N.jpg; ....)
/ select = list.masterlist.nextindex
/ selectionrate = always
/ position = (50%; 45%)
</picture>

However, when I have such a code, the program only uses the 120 items that I mentioned first within the Picture element.
If I try to enlarge the poolsize in my masterlist, for instance to 600, then the stimuli are chosen from the whole pool, but the proportion 50% for same list and 50% for different list doesn't work and the stimuli are picked merely on the random basis.

Could you please help to solve this issue?

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
Aleksandr - 1/31/2024
Hi, hope you're doing well!

I've been struggling with representing picture stimuli items from several lists.

I have 4 item elements each consisting of 15 stimuli items (60 in total). I also have another 60 item elements each consisting of 9 stimuli items (540 in total). Thus, overall I have 64 item elements and 600 different stimuli items. 

I want to create a <list SameList> and to put 4 item elements (consisting of 15 stimuli each) in it. I want all the 60 stimuli from this list to be used in the experiment in a random order. The code I wrote for this part:

<list SameList>
/ items = [item.SAMEN; item.SAMENR; item.SAMES; item.SAMESR]
/ poolsize = 60
/ itemprobabilities = uniform
/ selectionmode = random
/ selectionrate = always
/ replace = false
</list>

Then, I create another list <list DifferentList> for another 60 item elements (consisting of 9 stimuli each). I want only 60 stimuli from this pool of 540 stimuli of items to be used in the experiment. I want to make it in a way that only one random stimulus from each of the 60 item elements included in the list is chosen. I wrote it this way:

<list DifferentList>
/ items = [item.D1; ... ; item.D60]
/ poolsize = 60
/ itemprobabilities = uniform
/ selectionmode = random
/ selectionrate = always
/ replace = false
</list>

Lastly, I tried to create a list combining these two lists. I want at the end to have 120 stimuli to be represented (I have 120 trials): all the 60 from the 4 item elements in SameList and 60 stimuli (one random) from each of the 60 item elements in DifferentList. I want these 120 to be shown in a random order. 

<list masterlist>
/ items = [list.SameList; list.DifferentList]
/ poolsize = 120
/ itemprobabilities = [0.5; 0.5]
/ selectionmode = random 
/ selectionrate = always 
/ replace = false
</list>

Then I use Picture element to ask the program to represent the stimuli in line with my idea.
When I use picture element, the program requires either to mention all the 600 stimuli one by one or to refer to the one joint item element. I mention the 600 one by one.

<picture Stimulus>
/ items = ("A1N.jpg"; "A2N.jpg; ....)
/ select = list.masterlist.nextindex
/ selectionrate = always
/ position = (50%; 45%)
</picture>

However, when I have such a code, the program only uses the 120 items that I mentioned first within the Picture element.
If I try to enlarge the poolsize in my masterlist, for instance to 600, then the stimuli are chosen from the whole pool, but the proportion 50% for same list and 50% for different list doesn't work and the stimuli are picked merely on the random basis.

Could you please help to solve this issue?

As to your first setup, <list> elements simply don't work like that (and I have no idea where you get the idea that they do); you can't reference various <item> elements in a list's /items.

As to your second setup, the reason you're only getting the first 120 items used is because you have the picture element select based on <list masterlist>'s index

/ select = list.masterlist.nextindex

and that list's index runs from 1 to 120 per its /poolsize.
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
Dave - 1/31/2024
Aleksandr - 1/31/2024
Hi, hope you're doing well!

I've been struggling with representing picture stimuli items from several lists.

I have 4 item elements each consisting of 15 stimuli items (60 in total). I also have another 60 item elements each consisting of 9 stimuli items (540 in total). Thus, overall I have 64 item elements and 600 different stimuli items. 

I want to create a <list SameList> and to put 4 item elements (consisting of 15 stimuli each) in it. I want all the 60 stimuli from this list to be used in the experiment in a random order. The code I wrote for this part:

<list SameList>
/ items = [item.SAMEN; item.SAMENR; item.SAMES; item.SAMESR]
/ poolsize = 60
/ itemprobabilities = uniform
/ selectionmode = random
/ selectionrate = always
/ replace = false
</list>

Then, I create another list <list DifferentList> for another 60 item elements (consisting of 9 stimuli each). I want only 60 stimuli from this pool of 540 stimuli of items to be used in the experiment. I want to make it in a way that only one random stimulus from each of the 60 item elements included in the list is chosen. I wrote it this way:

<list DifferentList>
/ items = [item.D1; ... ; item.D60]
/ poolsize = 60
/ itemprobabilities = uniform
/ selectionmode = random
/ selectionrate = always
/ replace = false
</list>

Lastly, I tried to create a list combining these two lists. I want at the end to have 120 stimuli to be represented (I have 120 trials): all the 60 from the 4 item elements in SameList and 60 stimuli (one random) from each of the 60 item elements in DifferentList. I want these 120 to be shown in a random order. 

<list masterlist>
/ items = [list.SameList; list.DifferentList]
/ poolsize = 120
/ itemprobabilities = [0.5; 0.5]
/ selectionmode = random 
/ selectionrate = always 
/ replace = false
</list>

Then I use Picture element to ask the program to represent the stimuli in line with my idea.
When I use picture element, the program requires either to mention all the 600 stimuli one by one or to refer to the one joint item element. I mention the 600 one by one.

<picture Stimulus>
/ items = ("A1N.jpg"; "A2N.jpg; ....)
/ select = list.masterlist.nextindex
/ selectionrate = always
/ position = (50%; 45%)
</picture>

However, when I have such a code, the program only uses the 120 items that I mentioned first within the Picture element.
If I try to enlarge the poolsize in my masterlist, for instance to 600, then the stimuli are chosen from the whole pool, but the proportion 50% for same list and 50% for different list doesn't work and the stimuli are picked merely on the random basis.

Could you please help to solve this issue?

As to your first setup, <list> elements simply don't work like that (and I have no idea where you get the idea that they do); you can't reference various <item> elements in a list's /items.

As to your second setup, the reason you're only getting the first 120 items used is because you have the picture element select based on <list masterlist>'s index

/ select = list.masterlist.nextindex

and that list's index runs from 1 to 120 per its /poolsize.

The setup you need is something along the following lines (if you want to stick with different item elements for each category of stimulus). Here's an example with a reduced item set (5 items per category, 20 trials total) for the "same" trial:

<text sameN>
/ items = item.sameN
</text>

<text sameNR>
/ items = item.sameNR
</text>

<text sameS>
/ items = item.sameS
</text>

<text sameSR>
/ items = item.sameSR
</text>

<item sameN>
/ 1 = "Same_N_01"
/ 2 = "Same_N_02"
/ 3 = "Same_N_03"
/ 4 = "Same_N_04"
/ 5 = "Same_N_05"
</item>

<item sameNR>
/ 1 = "Same_NR_01"
/ 2 = "Same_NR_02"
/ 3 = "Same_NR_03"
/ 4 = "Same_NR_04"
/ 5 = "Same_NR_05"
</item>

<item sameS>
/ 1 = "Same_S_01"
/ 2 = "Same_S_02"
/ 3 = "Same_S_03"
/ 4 = "Same_S_04"
/ 5 = "Same_S_05"
</item>

<item sameSR>
/ 1 = "Same_SR_01"
/ 2 = "Same_SR_02"
/ 3 = "Same_SR_03"
/ 4 = "Same_SR_04"
/ 5 = "Same_SR_05"
</item>

<list sameList>
/ items = (text.sameN, text.sameNR, text.sameS, text.sameSR)
/ poolsize = 20
</list>

<trial sameTrial>
/ ontrialbegin = [
    trial.sameTrial.resetstimulusframes();
    trial.sameTrial.insertstimulusframe(list.sameList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block exampleblock>
/ trials = [1-20 = noreplace(trial.sameTrial)]
</block>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusnumber stimulusitem stimulusnumber stimulusitem response latency correct)
</data>


Works the the same way for the "different" stimuli / trial. The example uses <text> elements, but things work exactly the same when you have picture elements instead

Aleksandr
Aleksandr
Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)
Group: Forum Members
Posts: 8, Visits: 40
Thank you so much for such a quick and helpful reply, Dave!

Could you please have a look at how I proceeded to combine "Same" and "Different" parts? I followed your example and created <item>, <picture> and <list> elements for my set of "different" stimuli. Then I wrote this way to combine the two parts:

<list TotalList>
/ items = (list.SameList.nextvalue; list.DifferentList.nextvalue)
/ poolsize = 120
</list>

<trial TotalTrial>
/ ontrialbegin = [
    trial.TotalTrial.resetstimulusframes();
    trial.TotalTrial.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block TotalBlock>
/ trials = [1-120 = noreplace(trial.TotalTrial)]
</block>

Is this correct?
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
Aleksandr - 1/31/2024
Thank you so much for such a quick and helpful reply, Dave!

Could you please have a look at how I proceeded to combine "Same" and "Different" parts? I followed your example and created <item>, <picture> and <list> elements for my set of "different" stimuli. Then I wrote this way to combine the two parts:

<list TotalList>
/ items = (list.SameList.nextvalue; list.DifferentList.nextvalue)
/ poolsize = 120
</list>

<trial TotalTrial>
/ ontrialbegin = [
    trial.TotalTrial.resetstimulusframes();
    trial.TotalTrial.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block TotalBlock>
/ trials = [1-120 = noreplace(trial.TotalTrial)]
</block>

Is this correct?

This looks correct. The simple alternative would be to have two different trial elements, i.e.

<trial sameTrial>
/ ontrialbegin = [
    trial.sameTrial.resetstimulusframes();
    trial.sameTrial.insertstimulusframe(list.sameList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<trial differentTrial>
/ ontrialbegin = [
    trial.differentTrial.resetstimulusframes();
    trial.differentTrial.insertstimulusframe(list.differentList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block exampleblock>
/ trials = [1-120 = noreplace(trial.sameTrial, trial.differentTrial)]
</block>

Aleksandr
Aleksandr
Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)
Group: Forum Members
Posts: 8, Visits: 40
Dave - 1/31/2024
Aleksandr - 1/31/2024
Thank you so much for such a quick and helpful reply, Dave!

Could you please have a look at how I proceeded to combine "Same" and "Different" parts? I followed your example and created <item>, <picture> and <list> elements for my set of "different" stimuli. Then I wrote this way to combine the two parts:

<list TotalList>
/ items = (list.SameList.nextvalue; list.DifferentList.nextvalue)
/ poolsize = 120
</list>

<trial TotalTrial>
/ ontrialbegin = [
    trial.TotalTrial.resetstimulusframes();
    trial.TotalTrial.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block TotalBlock>
/ trials = [1-120 = noreplace(trial.TotalTrial)]
</block>

Is this correct?

This looks correct. The simple alternative would be to have two different trial elements, i.e.

<trial sameTrial>
/ ontrialbegin = [
    trial.sameTrial.resetstimulusframes();
    trial.sameTrial.insertstimulusframe(list.sameList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<trial differentTrial>
/ ontrialbegin = [
    trial.differentTrial.resetstimulusframes();
    trial.differentTrial.insertstimulusframe(list.differentList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block exampleblock>
/ trials = [1-120 = noreplace(trial.sameTrial, trial.differentTrial)]
</block>

Thank you
Aleksandr
Aleksandr
Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)
Group: Forum Members
Posts: 8, Visits: 40
Dave - 1/31/2024
Aleksandr - 1/31/2024
Thank you so much for such a quick and helpful reply, Dave!

Could you please have a look at how I proceeded to combine "Same" and "Different" parts? I followed your example and created <item>, <picture> and <list> elements for my set of "different" stimuli. Then I wrote this way to combine the two parts:

<list TotalList>
/ items = (list.SameList.nextvalue; list.DifferentList.nextvalue)
/ poolsize = 120
</list>

<trial TotalTrial>
/ ontrialbegin = [
    trial.TotalTrial.resetstimulusframes();
    trial.TotalTrial.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block TotalBlock>
/ trials = [1-120 = noreplace(trial.TotalTrial)]
</block>

Is this correct?

This looks correct. The simple alternative would be to have two different trial elements, i.e.

<trial sameTrial>
/ ontrialbegin = [
    trial.sameTrial.resetstimulusframes();
    trial.sameTrial.insertstimulusframe(list.sameList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<trial differentTrial>
/ ontrialbegin = [
    trial.differentTrial.resetstimulusframes();
    trial.differentTrial.insertstimulusframe(list.differentList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block exampleblock>
/ trials = [1-120 = noreplace(trial.sameTrial, trial.differentTrial)]
</block>

Hi Dave,

May I ask you one more question?

For the experiment I need to make the procedure a bit more complex: I have 120 trials and want them to consist of 120 stimuli (60 from Same pool and 60 from Different pool) as I described before, yet I need to provide slightly different instructions on the screen for the first 40 trials and the rest. Thus, I created two <trial> elements, this is what I have right now.

<list TotalList>
/ items = (list.SameList.nextvalue; list.DifferentList.nextvalue)
/ poolsize = 120
</list>

<trial trial1to40>
/ ontrialbegin = [
    trial.trial1to40.resetstimulusframes();
    trial.trial1to40.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen; 2 = instructions1]
/ validresponse = (44; 50)
/ iscorrectresponse = (list.TotalList.item(1) && trial.trial1to40.response == 44 || list.TotalList.item(2) && trial.trial1to40.response == 50)
</trial>

<trial trial41to120>
/ ontrialbegin = [
   trial.trial41to120.resetstimulusframes();
   trial.trial1to40.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen; 2 = instructions2]
/ validresponse = (44; 50)
/ iscorrectresponse = (list.TotalList.item(1) && trial.trial41to120.response == 44 || list.TotalList.item(2) && trial.trial41to120.response == 50)
</trial>

I believe with such a code my two <trial> elements are not actually connected. That is, stimuli for both trials are chosen following the same logic described in <list> elements but it can happen that some particular stimuli may appear several times – first in <trial1to40> and again in <trial40to120>, because it is not remembered by the program which particular stimuli have already been selected in another trial. I guess I need to use <counter> element to deal with this but I am not sure about how to do it. Could you please give me a hand with it?
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
Aleksandr - 2/3/2024
Dave - 1/31/2024
Aleksandr - 1/31/2024
Thank you so much for such a quick and helpful reply, Dave!

Could you please have a look at how I proceeded to combine "Same" and "Different" parts? I followed your example and created <item>, <picture> and <list> elements for my set of "different" stimuli. Then I wrote this way to combine the two parts:

<list TotalList>
/ items = (list.SameList.nextvalue; list.DifferentList.nextvalue)
/ poolsize = 120
</list>

<trial TotalTrial>
/ ontrialbegin = [
    trial.TotalTrial.resetstimulusframes();
    trial.TotalTrial.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block TotalBlock>
/ trials = [1-120 = noreplace(trial.TotalTrial)]
</block>

Is this correct?

This looks correct. The simple alternative would be to have two different trial elements, i.e.

<trial sameTrial>
/ ontrialbegin = [
    trial.sameTrial.resetstimulusframes();
    trial.sameTrial.insertstimulusframe(list.sameList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<trial differentTrial>
/ ontrialbegin = [
    trial.differentTrial.resetstimulusframes();
    trial.differentTrial.insertstimulusframe(list.differentList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block exampleblock>
/ trials = [1-120 = noreplace(trial.sameTrial, trial.differentTrial)]
</block>

Hi Dave,

May I ask you one more question?

For the experiment I need to make the procedure a bit more complex: I have 120 trials and want them to consist of 120 stimuli (60 from Same pool and 60 from Different pool) as I described before, yet I need to provide slightly different instructions on the screen for the first 40 trials and the rest. Thus, I created two <trial> elements, this is what I have right now.

<list TotalList>
/ items = (list.SameList.nextvalue; list.DifferentList.nextvalue)
/ poolsize = 120
</list>

<trial trial1to40>
/ ontrialbegin = [
    trial.trial1to40.resetstimulusframes();
    trial.trial1to40.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen; 2 = instructions1]
/ validresponse = (44; 50)
/ iscorrectresponse = (list.TotalList.item(1) && trial.trial1to40.response == 44 || list.TotalList.item(2) && trial.trial1to40.response == 50)
</trial>

<trial trial41to120>
/ ontrialbegin = [
   trial.trial41to120.resetstimulusframes();
   trial.trial1to40.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen; 2 = instructions2]
/ validresponse = (44; 50)
/ iscorrectresponse = (list.TotalList.item(1) && trial.trial41to120.response == 44 || list.TotalList.item(2) && trial.trial41to120.response == 50)
</trial>

I believe with such a code my two <trial> elements are not actually connected. That is, stimuli for both trials are chosen following the same logic described in <list> elements but it can happen that some particular stimuli may appear several times – first in <trial1to40> and again in <trial40to120>, because it is not remembered by the program which particular stimuli have already been selected in another trial. I guess I need to use <counter> element to deal with this but I am not sure about how to do it. Could you please give me a hand with it?

> I believe with such a code my two <trial> elements are not actually connected. That is, stimuli for both trials are chosen following the same logic described in <list> elements
> but it can happen that some particular stimuli may appear several times – first in <trial1to40> and again in <trial40to120>,
> because it is not remembered by the program which particular stimuli have already been selected in another trial.

No. You're sampling from the same list in these trials, so they are "connected." If you sample from the list no more than 120 times, then you''ll get no repeats. It does not matter whether those 120 samples are made by a single <trial> or multple <trial> elements. If you are seeing repeats, you have some other mistake in your code.

And the <counter> element is obsolete. The <list> element is its more versatile replacement.

Aleksandr
Aleksandr
Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)Associate Member (109 reputation)
Group: Forum Members
Posts: 8, Visits: 40
Dave - 2/3/2024
Aleksandr - 2/3/2024
Dave - 1/31/2024
Aleksandr - 1/31/2024
Thank you so much for such a quick and helpful reply, Dave!

Could you please have a look at how I proceeded to combine "Same" and "Different" parts? I followed your example and created <item>, <picture> and <list> elements for my set of "different" stimuli. Then I wrote this way to combine the two parts:

<list TotalList>
/ items = (list.SameList.nextvalue; list.DifferentList.nextvalue)
/ poolsize = 120
</list>

<trial TotalTrial>
/ ontrialbegin = [
    trial.TotalTrial.resetstimulusframes();
    trial.TotalTrial.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block TotalBlock>
/ trials = [1-120 = noreplace(trial.TotalTrial)]
</block>

Is this correct?

This looks correct. The simple alternative would be to have two different trial elements, i.e.

<trial sameTrial>
/ ontrialbegin = [
    trial.sameTrial.resetstimulusframes();
    trial.sameTrial.insertstimulusframe(list.sameList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<trial differentTrial>
/ ontrialbegin = [
    trial.differentTrial.resetstimulusframes();
    trial.differentTrial.insertstimulusframe(list.differentList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block exampleblock>
/ trials = [1-120 = noreplace(trial.sameTrial, trial.differentTrial)]
</block>

Hi Dave,

May I ask you one more question?

For the experiment I need to make the procedure a bit more complex: I have 120 trials and want them to consist of 120 stimuli (60 from Same pool and 60 from Different pool) as I described before, yet I need to provide slightly different instructions on the screen for the first 40 trials and the rest. Thus, I created two <trial> elements, this is what I have right now.

<list TotalList>
/ items = (list.SameList.nextvalue; list.DifferentList.nextvalue)
/ poolsize = 120
</list>

<trial trial1to40>
/ ontrialbegin = [
    trial.trial1to40.resetstimulusframes();
    trial.trial1to40.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen; 2 = instructions1]
/ validresponse = (44; 50)
/ iscorrectresponse = (list.TotalList.item(1) && trial.trial1to40.response == 44 || list.TotalList.item(2) && trial.trial1to40.response == 50)
</trial>

<trial trial41to120>
/ ontrialbegin = [
   trial.trial41to120.resetstimulusframes();
   trial.trial1to40.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen; 2 = instructions2]
/ validresponse = (44; 50)
/ iscorrectresponse = (list.TotalList.item(1) && trial.trial41to120.response == 44 || list.TotalList.item(2) && trial.trial41to120.response == 50)
</trial>

I believe with such a code my two <trial> elements are not actually connected. That is, stimuli for both trials are chosen following the same logic described in <list> elements but it can happen that some particular stimuli may appear several times – first in <trial1to40> and again in <trial40to120>, because it is not remembered by the program which particular stimuli have already been selected in another trial. I guess I need to use <counter> element to deal with this but I am not sure about how to do it. Could you please give me a hand with it?

> I believe with such a code my two <trial> elements are not actually connected. That is, stimuli for both trials are chosen following the same logic described in <list> elements
> but it can happen that some particular stimuli may appear several times – first in <trial1to40> and again in <trial40to120>,
> because it is not remembered by the program which particular stimuli have already been selected in another trial.

No. You're sampling from the same list in these trials, so they are "connected." If you sample from the list no more than 120 times, then you''ll get no repeats. It does not matter whether those 120 samples are made by a single <trial> or multple <trial> elements. If you are seeing repeats, you have some other mistake in your code.

And the <counter> element is obsolete. The <list> element is its more versatile replacement.

That's the great news, thank you so much for clarification!
And have a good weekend!
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
Aleksandr - 2/3/2024
Dave - 2/3/2024
Aleksandr - 2/3/2024
Dave - 1/31/2024
Aleksandr - 1/31/2024
Thank you so much for such a quick and helpful reply, Dave!

Could you please have a look at how I proceeded to combine "Same" and "Different" parts? I followed your example and created <item>, <picture> and <list> elements for my set of "different" stimuli. Then I wrote this way to combine the two parts:

<list TotalList>
/ items = (list.SameList.nextvalue; list.DifferentList.nextvalue)
/ poolsize = 120
</list>

<trial TotalTrial>
/ ontrialbegin = [
    trial.TotalTrial.resetstimulusframes();
    trial.TotalTrial.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block TotalBlock>
/ trials = [1-120 = noreplace(trial.TotalTrial)]
</block>

Is this correct?

This looks correct. The simple alternative would be to have two different trial elements, i.e.

<trial sameTrial>
/ ontrialbegin = [
    trial.sameTrial.resetstimulusframes();
    trial.sameTrial.insertstimulusframe(list.sameList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<trial differentTrial>
/ ontrialbegin = [
    trial.differentTrial.resetstimulusframes();
    trial.differentTrial.insertstimulusframe(list.differentList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = (57)
</trial>

<block exampleblock>
/ trials = [1-120 = noreplace(trial.sameTrial, trial.differentTrial)]
</block>

Hi Dave,

May I ask you one more question?

For the experiment I need to make the procedure a bit more complex: I have 120 trials and want them to consist of 120 stimuli (60 from Same pool and 60 from Different pool) as I described before, yet I need to provide slightly different instructions on the screen for the first 40 trials and the rest. Thus, I created two <trial> elements, this is what I have right now.

<list TotalList>
/ items = (list.SameList.nextvalue; list.DifferentList.nextvalue)
/ poolsize = 120
</list>

<trial trial1to40>
/ ontrialbegin = [
    trial.trial1to40.resetstimulusframes();
    trial.trial1to40.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen; 2 = instructions1]
/ validresponse = (44; 50)
/ iscorrectresponse = (list.TotalList.item(1) && trial.trial1to40.response == 44 || list.TotalList.item(2) && trial.trial1to40.response == 50)
</trial>

<trial trial41to120>
/ ontrialbegin = [
   trial.trial41to120.resetstimulusframes();
   trial.trial1to40.insertstimulusframe(list.TotalList.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen; 2 = instructions2]
/ validresponse = (44; 50)
/ iscorrectresponse = (list.TotalList.item(1) && trial.trial41to120.response == 44 || list.TotalList.item(2) && trial.trial41to120.response == 50)
</trial>

I believe with such a code my two <trial> elements are not actually connected. That is, stimuli for both trials are chosen following the same logic described in <list> elements but it can happen that some particular stimuli may appear several times – first in <trial1to40> and again in <trial40to120>, because it is not remembered by the program which particular stimuli have already been selected in another trial. I guess I need to use <counter> element to deal with this but I am not sure about how to do it. Could you please give me a hand with it?

> I believe with such a code my two <trial> elements are not actually connected. That is, stimuli for both trials are chosen following the same logic described in <list> elements
> but it can happen that some particular stimuli may appear several times – first in <trial1to40> and again in <trial40to120>,
> because it is not remembered by the program which particular stimuli have already been selected in another trial.

No. You're sampling from the same list in these trials, so they are "connected." If you sample from the list no more than 120 times, then you''ll get no repeats. It does not matter whether those 120 samples are made by a single <trial> or multple <trial> elements. If you are seeing repeats, you have some other mistake in your code.

And the <counter> element is obsolete. The <list> element is its more versatile replacement.

That's the great news, thank you so much for clarification!
And have a good weekend!

You do have a mistake here, unrelated to the original question:

<trial trial41to120>
/ ontrialbegin = [
 trial.trial41to120.resetstimulusframes();
 trial.trial1to40.insertstimulusframe(list.TotalList.nextvalue, 1); // wrong trial referenced
]
/ stimulusframes = [1=clearscreen; 2 = instructions2]
/ validresponse = (44; 50)
/ iscorrectresponse = (list.TotalList.item(1) && trial.trial41to120.response == 44 || list.TotalList.item(2) && trial.trial41to120.response == 50)
</trial>

Also , the /iscorrectresponse logic looks wrong, not sure what you think (list.TotalList.item(1) does, but what that means is you're simply retrieving the list's first item, which makes no sense in this context.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search