Text Insertion for basic text stimuli


Author
Message
vicki.rivera
vicki.rivera
Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)
Group: Forum Members
Posts: 10, Visits: 30

Hello,
I have what feels like a very simple question, but that I haven't been able to find the answer to in either the manual or the forum! I would like to insert / pipe the text of a text stimulus into other parts of the script. Essentially, in our task, we will have participants read about a person and some of their behaviors. Each participant will only read about one person whose name is selected from an item list. I would like to pipe the name that is selected for the participant into the instruction pages. Right now, I currently have it in the page element as "<%text.novelperson.currentitem%>", but this does not return the item that is actually selected for the participant's later trials. I have included some of the code below.

<text novelperson>
/ items = novelperson
/ selectionrate = experiment
/ position = (50%, 90%)
/ fontstyle = ("Arial", 6%, true)
</text>

<item novelperson>
/ 1 = "EMERSON"
/ 2 = "DAKOTA"
/ 3 = "SHILOH"
/ 4 = "RORY"
/ 5 = "SKYLER"
/ 6 = "CHARLIE"
/ 7 = "BLAKE"
/ 8 = "TATUM"
</item>

<page novelperson_intro1>
<br>
<h3><center>Today, you will be reading about <%text.novelperson.currentitem%>.</h3></center>
</page>

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: 13K, Visits: 104K
vicki.rivera - 12/2/2024

Hello,
I have what feels like a very simple question, but that I haven't been able to find the answer to in either the manual or the forum! I would like to insert / pipe the text of a text stimulus into other parts of the script. Essentially, in our task, we will have participants read about a person and some of their behaviors. Each participant will only read about one person whose name is selected from an item list. I would like to pipe the name that is selected for the participant into the instruction pages. Right now, I currently have it in the page element as "<%text.novelperson.currentitem%>", but this does not return the item that is actually selected for the participant's later trials. I have included some of the code below.

<text novelperson>
/ items = novelperson
/ selectionrate = experiment
/ position = (50%, 90%)
/ fontstyle = ("Arial", 6%, true)
</text>

<item novelperson>
/ 1 = "EMERSON"
/ 2 = "DAKOTA"
/ 3 = "SHILOH"
/ 4 = "RORY"
/ 5 = "SKYLER"
/ 6 = "CHARLIE"
/ 7 = "BLAKE"
/ 8 = "TATUM"
</item>

<page novelperson_intro1>
<br>
<h3><center>Today, you will be reading about <%text.novelperson.currentitem%>.</h3></center>
</page>

> this does not return the item that is actually selected for the participant's later trials.

That is precisely the problem. The item is only selected later, item selection on a stimulus element occurs when that stimulus is displayed. If the stimulus has never been displayed, there is no "current" item, and it will just always return the 1st item. So with

<text novelperson>
/ items = novelperson
/ selectionrate = experiment
/ position = (50%, 90%)
/ fontstyle = ("Arial", 6%, true)
</text>

<item novelperson>
/ 1 = "EMERSON"
/ 2 = "DAKOTA"
/ 3 = "SHILOH"
/ 4 = "RORY"
/ 5 = "SKYLER"
/ 6 = "CHARLIE"
/ 7 = "BLAKE"
/ 8 = "TATUM"
</item>

<page novelperson_intro1>
<br>
<h3><center>Today, you will be reading about <%text.novelperson.currentitem%>.</h3></center>
</page>

<expt myExpt>
/ preinstructions = (novelperson_intro1)
/ blocks = [1=myBlock]
</expt>

<block myBlock>
/ trials = [1=myTrial]
</block>

<trial myTrial>
/ stimulusframes = [1=novelperson]
/ validresponse = (" ")
</trial>


the actual item is only selected once myTrial displays the novelperson stimulus.

What you need to do is select one of the 8 name items before you do anything else, /onexptbegin.

<values>
/ personitemnumber = 0
</values>

<text novelperson>
/ items = novelperson
/ select = values.personitemnumber
/ position = (50%, 90%)
/ fontstyle = ("Arial", 6%, true)
</text>

<item novelperson>
/ 1 = "EMERSON"
/ 2 = "DAKOTA"
/ 3 = "SHILOH"
/ 4 = "RORY"
/ 5 = "SKYLER"
/ 6 = "CHARLIE"
/ 7 = "BLAKE"
/ 8 = "TATUM"
</item>

<page novelperson_intro1>
<br>
<h3><center>Today, you will be reading about <%item.novelperson.item(values.personitemnumber)%>.</h3></center>
</page>

<list personItemnumbers>
/ poolsize = 8
</list>


<expt myExpt>
/ onexptbegin = [
    values.personitemnumber = list.personItemnumbers.nextindex;
]
/ preinstructions = (novelperson_intro1)
/ blocks = [1=myBlock]
</expt>

<block myBlock>
/ trials = [1=myTrial]
</block>

<trial myTrial>
/ stimulusframes = [1=novelperson]
/ validresponse = (" ")
</trial>


Edited 2 days ago @ 2:08 PM by Dave
vicki.rivera
vicki.rivera
Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)Associate Member (50 reputation)
Group: Forum Members
Posts: 10, Visits: 30
Dave - 12/2/2024
vicki.rivera - 12/2/2024

Hello,
I have what feels like a very simple question, but that I haven't been able to find the answer to in either the manual or the forum! I would like to insert / pipe the text of a text stimulus into other parts of the script. Essentially, in our task, we will have participants read about a person and some of their behaviors. Each participant will only read about one person whose name is selected from an item list. I would like to pipe the name that is selected for the participant into the instruction pages. Right now, I currently have it in the page element as "<%text.novelperson.currentitem%>", but this does not return the item that is actually selected for the participant's later trials. I have included some of the code below.

<text novelperson>
/ items = novelperson
/ selectionrate = experiment
/ position = (50%, 90%)
/ fontstyle = ("Arial", 6%, true)
</text>

<item novelperson>
/ 1 = "EMERSON"
/ 2 = "DAKOTA"
/ 3 = "SHILOH"
/ 4 = "RORY"
/ 5 = "SKYLER"
/ 6 = "CHARLIE"
/ 7 = "BLAKE"
/ 8 = "TATUM"
</item>

<page novelperson_intro1>
<br>
<h3><center>Today, you will be reading about <%text.novelperson.currentitem%>.</h3></center>
</page>

> this does not return the item that is actually selected for the participant's later trials.

That is precisely the problem. The item is only selected later, item selection on a stimulus element occurs when that stimulus is displayed. If the stimulus has never been displayed, there is no "current" item, and it will just always return the 1st item. So with

<text novelperson>
/ items = novelperson
/ selectionrate = experiment
/ position = (50%, 90%)
/ fontstyle = ("Arial", 6%, true)
</text>

<item novelperson>
/ 1 = "EMERSON"
/ 2 = "DAKOTA"
/ 3 = "SHILOH"
/ 4 = "RORY"
/ 5 = "SKYLER"
/ 6 = "CHARLIE"
/ 7 = "BLAKE"
/ 8 = "TATUM"
</item>

<page novelperson_intro1>
<br>
<h3><center>Today, you will be reading about <%text.novelperson.currentitem%>.</h3></center>
</page>

<expt myExpt>
/ preinstructions = (novelperson_intro1)
/ blocks = [1=myBlock]
</expt>

<block myBlock>
/ trials = [1=myTrial]
</block>

<trial myTrial>
/ stimulusframes = [1=novelperson]
/ validresponse = (" ")
</trial>


the actual item is only selected once myTrial displays the novelperson stimulus.

What you need to do is select one of the 8 name items before you do anything else, /onexptbegin.

<values>
/ personitemnumber = 0
</values>

<text novelperson>
/ items = novelperson
/ select = values.personitemnumber
/ position = (50%, 90%)
/ fontstyle = ("Arial", 6%, true)
</text>

<item novelperson>
/ 1 = "EMERSON"
/ 2 = "DAKOTA"
/ 3 = "SHILOH"
/ 4 = "RORY"
/ 5 = "SKYLER"
/ 6 = "CHARLIE"
/ 7 = "BLAKE"
/ 8 = "TATUM"
</item>

<page novelperson_intro1>
<br>
<h3><center>Today, you will be reading about <%item.novelperson.item(values.personitemnumber)%>.</h3></center>
</page>

<list personItemnumbers>
/ poolsize = 8
</list>


<expt myExpt>
/ onexptbegin = [
    values.personitemnumber = list.personItemnumbers.nextindex;
]
/ preinstructions = (novelperson_intro1)
/ blocks = [1=myBlock]
</expt>

<block myBlock>
/ trials = [1=myTrial]
</block>

<trial myTrial>
/ stimulusframes = [1=novelperson]
/ validresponse = (" ")
</trial>


This makes a lot of sense; I was playing around with the values and list functions, but couldn't figure out how to then format the piped text. Thank you so much!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search