Changing the item of a stimulus across trials


Author
Message
NicoB
NicoB
New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)
Group: Forum Members
Posts: 7, Visits: 11
Dear Members,
does anyone know a way to change all items of a stimulus?

<values>
/ index = 1
</values>

<item numbers>
/ 1 = "1"
/ 2 = "2"
/ 3 = "3"
/ 4 = "4"
</item>

<item letters>
/ 1 = "a"
/ 2 = "b"
/ 3 = "c"
/ 4 = "d"
</item>

<text stim>
/ items = letters
/ select = values.index
</text>

<trial t1>
/ ontrialbegin = [
    //Some code to determine via values.index which letter is displayed
]
/ stimulusframes = [1 = stim]
/ inputdevice = mouse
/ validresponse = (text.stim)
</trial>

<trial t2>
/ ontrialbegin = [
    //Change the item of the stimulus to numbers
    //So one can determine which number is displayed via values.index
    //I thought of
    text.stim.clearitems();
    //and then append- or setitem(); However, I did not succed in resetting all the items.
]
/ stimulusframes = [1 = stim]
/ inputdevice = mouse
/ validresponse = (text.stim)
</trial>

<block run>
/ trials = [1 = t1; 2-5 = t2]
</block>


So in the first trial I want to select from the letters item via stim, in the second I want to select from the number item.
Is there a way asides from "stacking" the items or using multiple stimuli?

Kind regards, Nico

Dave
Dave
Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)
Group: Administrators
Posts: 11K, Visits: 71K
NicoB - 7/21/2021
Dear Members,
does anyone know a way to change all items of a stimulus?

<values>
/ index = 1
</values>

<item numbers>
/ 1 = "1"
/ 2 = "2"
/ 3 = "3"
/ 4 = "4"
</item>

<item letters>
/ 1 = "a"
/ 2 = "b"
/ 3 = "c"
/ 4 = "d"
</item>

<text stim>
/ items = letters
/ select = values.index
</text>

<trial t1>
/ ontrialbegin = [
    //Some code to determine via values.index which letter is displayed
]
/ stimulusframes = [1 = stim]
/ inputdevice = mouse
/ validresponse = (text.stim)
</trial>

<trial t2>
/ ontrialbegin = [
    //Change the item of the stimulus to numbers
    //So one can determine which number is displayed via values.index
    //I thought of
    text.stim.clearitems();
    //and then append- or setitem(); However, I did not succed in resetting all the items.
]
/ stimulusframes = [1 = stim]
/ inputdevice = mouse
/ validresponse = (text.stim)
</trial>

<block run>
/ trials = [1 = t1; 2-5 = t2]
</block>


So in the first trial I want to select from the letters item via stim, in the second I want to select from the number item.
Is there a way asides from "stacking" the items or using multiple stimuli?

Kind regards, Nico

There are multiple ways to do this (some of which you already mentioned). Before I say anything about this, however, please explain in sufficient detail what the ultimate purpose of this setup is. I.e. why do you believe you must set up things this way?

As long as I don't have a clear(er) understanding of what exactly you want to achieve and why, I cannot advise you properly. It may not make sense to do things in the way you plan to do them, there may be pitfalls you have not considered, and there may be much simpler and better ways to get where you want to go.
NicoB
NicoB
New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)
Group: Forum Members
Posts: 7, Visits: 11
Dave - 7/21/2021
NicoB - 7/21/2021
Dear Members,
does anyone know a way to change all items of a stimulus?

<values>
/ index = 1
</values>

<item numbers>
/ 1 = "1"
/ 2 = "2"
/ 3 = "3"
/ 4 = "4"
</item>

<item letters>
/ 1 = "a"
/ 2 = "b"
/ 3 = "c"
/ 4 = "d"
</item>

<text stim>
/ items = letters
/ select = values.index
</text>

<trial t1>
/ ontrialbegin = [
    //Some code to determine via values.index which letter is displayed
]
/ stimulusframes = [1 = stim]
/ inputdevice = mouse
/ validresponse = (text.stim)
</trial>

<trial t2>
/ ontrialbegin = [
    //Change the item of the stimulus to numbers
    //So one can determine which number is displayed via values.index
    //I thought of
    text.stim.clearitems();
    //and then append- or setitem(); However, I did not succed in resetting all the items.
]
/ stimulusframes = [1 = stim]
/ inputdevice = mouse
/ validresponse = (text.stim)
</trial>

<block run>
/ trials = [1 = t1; 2-5 = t2]
</block>


So in the first trial I want to select from the letters item via stim, in the second I want to select from the number item.
Is there a way asides from "stacking" the items or using multiple stimuli?

Kind regards, Nico

There are multiple ways to do this (some of which you already mentioned). Before I say anything about this, however, please explain in sufficient detail what the ultimate purpose of this setup is. I.e. why do you believe you must set up things this way?

As long as I don't have a clear(er) understanding of what exactly you want to achieve and why, I cannot advise you properly. It may not make sense to do things in the way you plan to do them, there may be pitfalls you have not considered, and there may be much simpler and better ways to get where you want to go.
Fair enough.
I have a test in which children are asked a question and then must choose one of four pictures as an answer. Each of those questions is a trial.
As the questions belong into different categories and I need to be able to control how many questions of each category are asked.
Additionally, some questions require a different layout (answers need to be smaller and the question is supported by an additional picture).

My plan is to create an item of picture paths (<item cat1>, <item cat2>, etc.) as well as a trial for each different category.
(answers for each question are stored in 4 consecutive slots in a category item)
As I wasn't sure how Inquisit handles the stress of a bunch of created but only once used stimuli, I wanted to reuse the stimuli that I used in the other trials by changing their item and repositioning them on the screen. As I write this out, however, the thought of just using multiple stimuli seems to be logically sounder a conclusion. Even using only one item seems now a better idea (even though it would hold more than 300 paths), seeing as I can access the items with some trivial math.

So thanks, I guess, for making me reconsider my plan. As you asked, which (if any) of those 3 possible solutions would you recommend. (I, for my inexperienced part, am not able to see the pitfalls of any)

Dave
Dave
Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)Supreme Being (950K reputation)
Group: Administrators
Posts: 11K, Visits: 71K
NicoB - 7/21/2021
Dave - 7/21/2021
NicoB - 7/21/2021
Dear Members,
does anyone know a way to change all items of a stimulus?

<values>
/ index = 1
</values>

<item numbers>
/ 1 = "1"
/ 2 = "2"
/ 3 = "3"
/ 4 = "4"
</item>

<item letters>
/ 1 = "a"
/ 2 = "b"
/ 3 = "c"
/ 4 = "d"
</item>

<text stim>
/ items = letters
/ select = values.index
</text>

<trial t1>
/ ontrialbegin = [
    //Some code to determine via values.index which letter is displayed
]
/ stimulusframes = [1 = stim]
/ inputdevice = mouse
/ validresponse = (text.stim)
</trial>

<trial t2>
/ ontrialbegin = [
    //Change the item of the stimulus to numbers
    //So one can determine which number is displayed via values.index
    //I thought of
    text.stim.clearitems();
    //and then append- or setitem(); However, I did not succed in resetting all the items.
]
/ stimulusframes = [1 = stim]
/ inputdevice = mouse
/ validresponse = (text.stim)
</trial>

<block run>
/ trials = [1 = t1; 2-5 = t2]
</block>


So in the first trial I want to select from the letters item via stim, in the second I want to select from the number item.
Is there a way asides from "stacking" the items or using multiple stimuli?

Kind regards, Nico

There are multiple ways to do this (some of which you already mentioned). Before I say anything about this, however, please explain in sufficient detail what the ultimate purpose of this setup is. I.e. why do you believe you must set up things this way?

As long as I don't have a clear(er) understanding of what exactly you want to achieve and why, I cannot advise you properly. It may not make sense to do things in the way you plan to do them, there may be pitfalls you have not considered, and there may be much simpler and better ways to get where you want to go.
Fair enough.
I have a test in which children are asked a question and then must choose one of four pictures as an answer. Each of those questions is a trial.
As the questions belong into different categories and I need to be able to control how many questions of each category are asked.
Additionally, some questions require a different layout (answers need to be smaller and the question is supported by an additional picture).

My plan is to create an item of picture paths (<item cat1>, <item cat2>, etc.) as well as a trial for each different category.
(answers for each question are stored in 4 consecutive slots in a category item)
As I wasn't sure how Inquisit handles the stress of a bunch of created but only once used stimuli, I wanted to reuse the stimuli that I used in the other trials by changing their item and repositioning them on the screen. As I write this out, however, the thought of just using multiple stimuli seems to be logically sounder a conclusion. Even using only one item seems now a better idea (even though it would hold more than 300 paths), seeing as I can access the items with some trivial math.

So thanks, I guess, for making me reconsider my plan. As you asked, which (if any) of those 3 possible solutions would you recommend. (I, for my inexperienced part, am not able to see the pitfalls of any)

Performance- and memory-consumption-wise, either (1) per-category stimuli, or (2) and single item element containing all image paths are far better options than constantly copying back and forth between <item> elements. 300 images are not a problem for a single <item> element per se.

Neither option #1 or #2 should require more code either, since the copying-logic would probably eat more LOCs than defining per-category stimuli or a single <item> element. Personally, I like to do the latter, see .e.g.

https://www.millisecond.com/forums/FindPost24476.aspx
or
https://www.millisecond.com/forums/FindPost23028.aspx

but defining separate stimuli is perfectly fine as well.


NicoB
NicoB
New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)New Member (30 reputation)
Group: Forum Members
Posts: 7, Visits: 11
Dave - 7/21/2021
NicoB - 7/21/2021
Dave - 7/21/2021
NicoB - 7/21/2021
Dear Members,
does anyone know a way to change all items of a stimulus?

<values>
/ index = 1
</values>

<item numbers>
/ 1 = "1"
/ 2 = "2"
/ 3 = "3"
/ 4 = "4"
</item>

<item letters>
/ 1 = "a"
/ 2 = "b"
/ 3 = "c"
/ 4 = "d"
</item>

<text stim>
/ items = letters
/ select = values.index
</text>

<trial t1>
/ ontrialbegin = [
    //Some code to determine via values.index which letter is displayed
]
/ stimulusframes = [1 = stim]
/ inputdevice = mouse
/ validresponse = (text.stim)
</trial>

<trial t2>
/ ontrialbegin = [
    //Change the item of the stimulus to numbers
    //So one can determine which number is displayed via values.index
    //I thought of
    text.stim.clearitems();
    //and then append- or setitem(); However, I did not succed in resetting all the items.
]
/ stimulusframes = [1 = stim]
/ inputdevice = mouse
/ validresponse = (text.stim)
</trial>

<block run>
/ trials = [1 = t1; 2-5 = t2]
</block>


So in the first trial I want to select from the letters item via stim, in the second I want to select from the number item.
Is there a way asides from "stacking" the items or using multiple stimuli?

Kind regards, Nico

There are multiple ways to do this (some of which you already mentioned). Before I say anything about this, however, please explain in sufficient detail what the ultimate purpose of this setup is. I.e. why do you believe you must set up things this way?

As long as I don't have a clear(er) understanding of what exactly you want to achieve and why, I cannot advise you properly. It may not make sense to do things in the way you plan to do them, there may be pitfalls you have not considered, and there may be much simpler and better ways to get where you want to go.
Fair enough.
I have a test in which children are asked a question and then must choose one of four pictures as an answer. Each of those questions is a trial.
As the questions belong into different categories and I need to be able to control how many questions of each category are asked.
Additionally, some questions require a different layout (answers need to be smaller and the question is supported by an additional picture).

My plan is to create an item of picture paths (<item cat1>, <item cat2>, etc.) as well as a trial for each different category.
(answers for each question are stored in 4 consecutive slots in a category item)
As I wasn't sure how Inquisit handles the stress of a bunch of created but only once used stimuli, I wanted to reuse the stimuli that I used in the other trials by changing their item and repositioning them on the screen. As I write this out, however, the thought of just using multiple stimuli seems to be logically sounder a conclusion. Even using only one item seems now a better idea (even though it would hold more than 300 paths), seeing as I can access the items with some trivial math.

So thanks, I guess, for making me reconsider my plan. As you asked, which (if any) of those 3 possible solutions would you recommend. (I, for my inexperienced part, am not able to see the pitfalls of any)

Performance- and memory-consumption-wise, either (1) per-category stimuli, or (2) and single item element containing all image paths are far better options than constantly copying back and forth between <item> elements. 300 images are not a problem for a single <item> element per se.

Neither option #1 or #2 should require more code either, since the copying-logic would probably eat more LOCs than defining per-category stimuli or a single <item> element. Personally, I like to do the latter, see .e.g.

https://www.millisecond.com/forums/FindPost24476.aspx
or
https://www.millisecond.com/forums/FindPost23028.aspx

but defining separate stimuli is perfectly fine as well.


Thanks Dave,
went for the one item option, had some unexpected upsides and works perfectly so far!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search