Defining an item/text element with conditional logic using ontrialend


Author
Message
jfanderson
jfanderson
Partner Member (767 reputation)Partner Member (767 reputation)Partner Member (767 reputation)Partner Member (767 reputation)Partner Member (767 reputation)Partner Member (767 reputation)Partner Member (767 reputation)Partner Member (767 reputation)Partner Member (767 reputation)
Group: Forum Members
Posts: 5, Visits: 12
Hello,

I'm trying to define a name to be presented later to participants which will depend on their gender (provided in a dropdown response). The item and text elements do end up defined, but they aren't based on the logic and instead simply go with the first definition listed. Specifically, using the following:

<survey demographics>
/ pages = [1=demographics1; 2=demographics2]
/ itemspacing = 20px
/ showpagenumbers = false
/ ontrialend = [if (dropdown.sex.response = "female") item.ambigscentarget.item = "Maria"; if (dropdown.sex.response = "male") item.ambigscentarget.item = "Thomas"]
</survey>

<text ambigscentarget>
/ numitems = 1
/ items = ambigscentarget
/ select = noreplace
</text>

<item ambigscentarget>
</item>

ambigscentarget is always defined as "Maria" regardless of the participant's sex.

Any thoughts on how to adjust the logic to make things work?

Thanks in advance!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search