randomly varying the parts of the text item


Author
Message
deh
deh
Associate Member (122 reputation)Associate Member (122 reputation)Associate Member (122 reputation)Associate Member (122 reputation)Associate Member (122 reputation)Associate Member (122 reputation)Associate Member (122 reputation)Associate Member (122 reputation)Associate Member (122 reputation)
Group: Forum Members
Posts: 11, Visits: 68
Hi,

Is there a way to randomly vary some part of the text item? I would like to randomly present a description of a person, but at the same time vary their names.
I know that I could do this by just making two sets of text. However, in this case, there is a problem with positioning the names and the descriptions, because the lengths of names and descriptions vary, and therefore, the positions need to be adjusted per item accordingly.

So I was wondering if there's a way to randomly vary the name part of each description item, and track which name was presented for each trial.

Thank you!


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
deh - 10/16/2020
Hi,

Is there a way to randomly vary some part of the text item? I would like to randomly present a description of a person, but at the same time vary their names.
I know that I could do this by just making two sets of text. However, in this case, there is a problem with positioning the names and the descriptions, because the lengths of names and descriptions vary, and therefore, the positions need to be adjusted per item accordingly.

So I was wondering if there's a way to randomly vary the name part of each description item, and track which name was presented for each trial.

Thank you!


<values>
/ currentname = ""
/ currentage = 0
</values>

<list randomnames>
/ items = ("Anna", "Barbara")
</list>

<list randomages>
/ items = ("24", "53")
/ selectionmode = list.randomnames.currentindex
</list>

<expt>
/ blocks = [1-2 = example]
</expt>

<block example>
/ onblockbegin = [
    values.currentname = list.randomnames.nextvalue;
    values.currentage = list.randomages.nextvalue;
]
/ trials = [1-2 = exampletrial]
</block>

<trial exampletrial>
/ stimulusframes = [1=description]
/ validresponse = (57)
</trial>

<text description>
/ items = descriptionitems
/ select = sequence
</text>

<item descriptionitems>
/ 1 = "This is <%values.currentname%>."
/ 2 = "<%values.currentname%> is <%values.currentage%> years old."
</item>


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 - 10/16/2020
deh - 10/16/2020
Hi,

Is there a way to randomly vary some part of the text item? I would like to randomly present a description of a person, but at the same time vary their names.
I know that I could do this by just making two sets of text. However, in this case, there is a problem with positioning the names and the descriptions, because the lengths of names and descriptions vary, and therefore, the positions need to be adjusted per item accordingly.

So I was wondering if there's a way to randomly vary the name part of each description item, and track which name was presented for each trial.

Thank you!


<values>
/ currentname = ""
/ currentage = 0
</values>

<list randomnames>
/ items = ("Anna", "Barbara")
</list>

<list randomages>
/ items = ("24", "53")
/ selectionmode = list.randomnames.currentindex
</list>

<expt>
/ blocks = [1-2 = example]
</expt>

<block example>
/ onblockbegin = [
    values.currentname = list.randomnames.nextvalue;
    values.currentage = list.randomages.nextvalue;
]
/ trials = [1-2 = exampletrial]
</block>

<trial exampletrial>
/ stimulusframes = [1=description]
/ validresponse = (57)
</trial>

<text description>
/ items = descriptionitems
/ select = sequence
</text>

<item descriptionitems>
/ 1 = "This is <%values.currentname%>."
/ 2 = "<%values.currentname%> is <%values.currentage%> years old."
</item>


Also see https://www.millisecond.com/forums/FindPost28411.aspx
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search