+xHi everyone,
I'm struggling with a seemgly very simple task. I have a set of 7 items (nationalities) and I ask participants on a survey page (dropdown question) to indicate their nationality.
<text nationalities>
/ items = nationalities
</text>
<item nationalities>
/ 1="United Kingdom" / 2="Poland" / 3="Portugal" / 4="Italy" / 5="Germany" / 6="Spain" / 7="Sweden"
</item>
<surveypage nationalitypage>
/ questions = [1=nationality_question]
</surveypage>
<dropdown nationality_question>
/ caption = "Nationality"
/ options = ("<%item.nationalities.item(1)%>", "<%item.nationalities.item(2)%>", "<%item.nationalities.item(3)%>", "<%item.nationalities.item(4)%>", "<%item.nationalities.item(5)%>",
"<%item.nationalities.item(6)%>", "<%item.nationalities.item(7)%>")
/ optionvalues = ("1";"2";"3";"4";"5";"6";"7")
/ required = true
/ order = random
</dropdown>
Next, I want to add a second question in which the response of the nationality_question is excluded from the item pool (i.e. only 6 options). Finally, I need to split the initially 7 items up into 3 groups: Group 1 contains the response of the nationality_question, group 2 should be randomly chosen to be one of the items that was not selected in either question, group 3 should be the rest (i.e. 4 items) that was not selected in either question. Group 1 is no issue, but I have trouble with 2 & 3.
<item group1>
/ 1 = "<%dropdown.nationality_question.selectedcaption%>"
</item>
Thank you so much in adavance!
Best wishes,
Dave
<text nationalities>
/ items = nationalities
</text>
<item nationalities>
/ 1="United Kingdom"
/ 2="Poland"
/ 3="Portugal"
/ 4="Italy"
/ 5="Germany"
/ 6="Spain"
/ 7="Sweden"
</item>
<values>
/ rand = 0
</values>
<surveypage nationalitypage1>
/ ontrialend = [
item.first_nationality.appenditem(item.nationalities.item(dropdown.nationality_question1.response));
item.nationalities.removeitem(dropdown.nationality_question1.response);
]
/ questions = [1=nationality_question1]
</surveypage>
<surveypage nationalitypage2>
/ ontrialend = [
item.second_nationality.appenditem(item.nationalities.item(dropdown.nationality_question2.response));
item.nationalities.removeitem(dropdown.nationality_question2.response);
]
/ ontrialend = [
values.rand = replace(1,2,3,4,5);
item.random_nationality.appenditem(item.nationalities.item(values.rand));
item.nationalities.removeitem(values.rand);
]
/ ontrialend = [
item.rest.appenditem(item.nationalities.item(1));
item.rest.appenditem(item.nationalities.item(2));
item.rest.appenditem(item.nationalities.item(3));
item.rest.appenditem(item.nationalities.item(4));
]
/ questions = [1=nationality_question2]
</surveypage>
<dropdown nationality_question1>
/ caption = "Nationality"
/ options = ("<%item.nationalities.item(1)%>", "<%item.nationalities.item(2)%>", "<%item.nationalities.item(3)%>", "<%item.nationalities.item(4)%>", "<%item.nationalities.item(5)%>",
"<%item.nationalities.item(6)%>", "<%item.nationalities.item(7)%>")
/ optionvalues = ("1";"2";"3";"4";"5";"6";"7")
/ required = true
/ order = random
</dropdown>
<dropdown nationality_question2>
/ caption = "Nationality"
/ options = ("<%item.nationalities.item(1)%>", "<%item.nationalities.item(2)%>", "<%item.nationalities.item(3)%>", "<%item.nationalities.item(4)%>", "<%item.nationalities.item(5)%>",
"<%item.nationalities.item(6)%>")
/ optionvalues = ("1";"2";"3";"4";"5";"6")
/ required = true
/ order = random
</dropdown>
<block myblock>
/ postinstructions = (summary)
/ trials = [1=nationalitypage1; 2=nationalitypage2]
</block>
<page summary>
^nationality #1: <%item.first_nationality.item(1)%>
^nationality #2: <%item.second_nationality.item(1)%>
^random nationality: <%item.random_nationality.item(1)%>
^the rest: <%item.rest.item(1)%>, <%item.rest.item(2)%>, <%item.rest.item(3)%>, <%item.rest.item(4)%>,
</page>
<item first_nationality>
</item>
<item second_nationality>
</item>
<item random_nationality>
</item>
<item rest>
</item>