Millisecond Forums

Showing items depending on gender

https://forums.millisecond.com/Topic19037.aspx

By nonamenick - 5/8/2016

I have a task where, depending on the gender of the participant, they are given different pictures (technically only one pic of 30 is different).

<block Neutral>
/branch = [if (radiobuttons.sex.response == "male") trial.task1trialMale]
/ trials = [1-30= sequence(task1trialMale, imgratingneu)]
/branch = [if (radiobuttons.sex.response == "female") trial.task1trialFemale]
/ trials = [1-30= sequence(task1trialFemale, imgratingneu)]
</block>

This is what I have for the block for designating the trials depending on gender, however when I run it, it always shows the female trial. I'm not sure if this is the best way to do it but I could not really find anything on group asssignment by gender. Another option is that if there is no response for gender they are given the female version of the trial.

As always, any help would be greatly appreciated.

Thanks


By Dave - 5/8/2016

#1: A <block> cannot /branch to a <trial>. Branches must be at the same "level", i.e., a <block> can only /branch to another <block>. A <trial> can only /branch to another <trial>.

#2: You may not have several /trials attributes in a single <block>, there may only be one.

In sum, you need two separate <block> elements -- one for the male trials, another one for the female trials -- and you need to either /branch to the applicable <block> or /skip the non-applicable one.

See this recent example: https://www.millisecond.com/forums/Topic18963.aspx