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
Dave - 2/3/2024
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.

Thank you!
With /iscorrectresponse I intended to program different buttons on the keyboard as correct depending on whether the stimulus goes from the SameList or from the DifferentList. I thought that, given that SameList is the first item in the TotalList and DifferentList is the second item in the TotalList, I would be able to program the correct response this way.
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: 99K
Aleksandr - 2/3/2024
Dave - 2/3/2024
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.

Thank you!
With /iscorrectresponse I intended to program different buttons on the keyboard as correct depending on whether the stimulus goes from the SameList or from the DifferentList. I thought that, given that SameList is the first item in the TotalList and DifferentList is the second item in the TotalList, I would be able to program the correct response this way.

Well, you're not checking whether the 1st or 2nd item was selected in the current trial, you're just retrieving the first and second items (whatever they are at that point). What you want is a proper logical check, i.e. something along the lines of

list.TotalList.currentindex == 1 vs list.TotalList.currentindex == 2
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 - 2/3/2024
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.

Thank you!
With /iscorrectresponse I intended to program different buttons on the keyboard as correct depending on whether the stimulus goes from the SameList or from the DifferentList. I thought that, given that SameList is the first item in the TotalList and DifferentList is the second item in the TotalList, I would be able to program the correct response this way.

Well, you're not checking whether the 1st or 2nd item was selected in the current trial, you're just retrieving the first and second items (whatever they are at that point). What you want is a proper logical check, i.e. something along the lines of

list.TotalList.currentindex == 1 vs list.TotalList.currentindex == 2

Got it! Thank you so much, I really appreciate your help!
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: 99K
Aleksandr - 2/3/2024
Dave - 2/3/2024
Aleksandr - 2/3/2024
Dave - 2/3/2024
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.

Thank you!
With /iscorrectresponse I intended to program different buttons on the keyboard as correct depending on whether the stimulus goes from the SameList or from the DifferentList. I thought that, given that SameList is the first item in the TotalList and DifferentList is the second item in the TotalList, I would be able to program the correct response this way.

Well, you're not checking whether the 1st or 2nd item was selected in the current trial, you're just retrieving the first and second items (whatever they are at that point). What you want is a proper logical check, i.e. something along the lines of

list.TotalList.currentindex == 1 vs list.TotalList.currentindex == 2

Got it! Thank you so much, I really appreciate your help!

Eh, wait. That won't work because of the poolsize. You'll need to check whether the index is <= 60 vs > 60. In a nutshell:

<list mylist>
/ items = (text.a, text.b)
/ poolsize = 120
</list>

<trial mytrial>
/ ontrialbegin = [
    trial.mytrial.resetstimulusframes();
    trial.mytrial.insertstimulusframe(list.mylist.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = ("A", "B")
/ iscorrectresponse = [
    (list.mylist.currentindex <= 60 && trial.mytrial.responsetext == "A") || (list.mylist.currentindex > 60 && trial.mytrial.responsetext == "B")
]
</trial>

<text a>
/ items = ("A")
</text>

<text b>
/ items = ("B")
</text>

<block myblock>
/ trials = [1-120 = trial.mytrial]
</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 - 2/3/2024
Aleksandr - 2/3/2024
Dave - 2/3/2024
Aleksandr - 2/3/2024
Dave - 2/3/2024
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.

Thank you!
With /iscorrectresponse I intended to program different buttons on the keyboard as correct depending on whether the stimulus goes from the SameList or from the DifferentList. I thought that, given that SameList is the first item in the TotalList and DifferentList is the second item in the TotalList, I would be able to program the correct response this way.

Well, you're not checking whether the 1st or 2nd item was selected in the current trial, you're just retrieving the first and second items (whatever they are at that point). What you want is a proper logical check, i.e. something along the lines of

list.TotalList.currentindex == 1 vs list.TotalList.currentindex == 2

Got it! Thank you so much, I really appreciate your help!

Eh, wait. That won't work because of the poolsize. You'll need to check whether the index is <= 60 vs > 60. In a nutshell:

<list mylist>
/ items = (text.a, text.b)
/ poolsize = 120
</list>

<trial mytrial>
/ ontrialbegin = [
    trial.mytrial.resetstimulusframes();
    trial.mytrial.insertstimulusframe(list.mylist.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = ("A", "B")
/ iscorrectresponse = [
    (list.mylist.currentindex <= 60 && trial.mytrial.responsetext == "A") || (list.mylist.currentindex > 60 && trial.mytrial.responsetext == "B")
]
</trial>

<text a>
/ items = ("A")
</text>

<text b>
/ items = ("B")
</text>

<block myblock>
/ trials = [1-120 = trial.mytrial]
</block>

Okay. So it works in a way that when there is a poolsize determined, as in this case to 120, and there are several items in the list, say text.a and text.b, the program creates a pool wherein the first 60 items come from text.a and another 60 items come from text.b and then presents them in a random order if other is not specified, is that correct? So to program the correct response we refer to the items' index. Did I understand the logic right?
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: 99K
Aleksandr - 2/3/2024
Dave - 2/3/2024
Aleksandr - 2/3/2024
Dave - 2/3/2024
Aleksandr - 2/3/2024
Dave - 2/3/2024
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.

Thank you!
With /iscorrectresponse I intended to program different buttons on the keyboard as correct depending on whether the stimulus goes from the SameList or from the DifferentList. I thought that, given that SameList is the first item in the TotalList and DifferentList is the second item in the TotalList, I would be able to program the correct response this way.

Well, you're not checking whether the 1st or 2nd item was selected in the current trial, you're just retrieving the first and second items (whatever they are at that point). What you want is a proper logical check, i.e. something along the lines of

list.TotalList.currentindex == 1 vs list.TotalList.currentindex == 2

Got it! Thank you so much, I really appreciate your help!

Eh, wait. That won't work because of the poolsize. You'll need to check whether the index is <= 60 vs > 60. In a nutshell:

<list mylist>
/ items = (text.a, text.b)
/ poolsize = 120
</list>

<trial mytrial>
/ ontrialbegin = [
    trial.mytrial.resetstimulusframes();
    trial.mytrial.insertstimulusframe(list.mylist.nextvalue, 1);
]
/ stimulusframes = [1=clearscreen]
/ validresponse = ("A", "B")
/ iscorrectresponse = [
    (list.mylist.currentindex <= 60 && trial.mytrial.responsetext == "A") || (list.mylist.currentindex > 60 && trial.mytrial.responsetext == "B")
]
</trial>

<text a>
/ items = ("A")
</text>

<text b>
/ items = ("B")
</text>

<block myblock>
/ trials = [1-120 = trial.mytrial]
</block>

Okay. So it works in a way that when there is a poolsize determined, as in this case to 120, and there are several items in the list, say text.a and text.b, the program creates a pool wherein the first 60 items come from text.a and another 60 items come from text.b and then presents them in a random order if other is not specified, is that correct? So to program the correct response we refer to the items' index. Did I understand the logic right?

Yes.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search