select brand based on selection questions in survey elements


Author
Message
MichelleSnelleman
MichelleSnelleman
Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)
Group: Forum Members
Posts: 6, Visits: 13
Good day,
Currently I am working on a brand association test using 4 different brands, 1 brand is always in the task, the other three brands are competitors of the first brand. I've built the task for all brands and all is working fine.
Selection of the competing brand needs to be done based on survey questions. These questions have branching as well:
Q1: answers -> a-g. Answers a,b,c,f,g go to Q2, answers d and e go to the brand association task for competitor HR
Q2: answer a -> competitor HH
       answer b -> competitor HvA
       answer c -> competitor HR
       answer d-> Q3

Q3: answer a -> competitor HH
       answer b -> competitor HvA
       answer c -> competitor HR
       answer d-> competitor HR

I've tried to use the batch element with a selection survey, does not work. Branching also does not seem to work. Also tried responsetrial but does not seem to work.

What are your suggestions? Thanks so much in advance!

Kind regards,
Michelle Snelleman


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
MichelleSnelleman - 6/1/2019
Good day,
Currently I am working on a brand association test using 4 different brands, 1 brand is always in the task, the other three brands are competitors of the first brand. I've built the task for all brands and all is working fine.
Selection of the competing brand needs to be done based on survey questions. These questions have branching as well:
Q1: answers -> a-g. Answers a,b,c,f,g go to Q2, answers d and e go to the brand association task for competitor HR
Q2: answer a -> competitor HH
       answer b -> competitor HvA
       answer c -> competitor HR
       answer d-> Q3

Q3: answer a -> competitor HH
       answer b -> competitor HvA
       answer c -> competitor HR
       answer d-> competitor HR

I've tried to use the batch element with a selection survey, does not work. Branching also does not seem to work. Also tried responsetrial but does not seem to work.

What are your suggestions? Thanks so much in advance!

Kind regards,
Michelle Snelleman


Branching would be the way to go as opposed to using a <batch> approach. What you've done wrong I can't say, since you didn't share any of the relevant code.

MichelleSnelleman
MichelleSnelleman
Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)
Group: Forum Members
Posts: 6, Visits: 13
Dave - 6/3/2019

Branching would be the way to go as opposed to using a <batch> approach. What you've done wrong I can't say, since you didn't share any of the relevant code.

Dear Dave,

Tjanks for your reply, I've included my code as an attachment. Thanks again for your valuable advice!

Kind regards, 
Michelle
Attachments
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
MichelleSnelleman - 6/3/2019
Dave - 6/3/2019

Branching would be the way to go as opposed to using a <batch> approach. What you've done wrong I can't say, since you didn't share any of the relevant code.

Dear Dave,

Tjanks for your reply, I've included my code as an attachment. Thanks again for your valuable advice!

Kind regards, 
Michelle

Thanks for the script, but:

#1: Please take the time and actually point to the relevant sections of the code and please refer to the relevant elements exactly as they are named in the script. There is not a single /branch attribute in the script you attached, so I'm not sure how I am supposed to figure out where in your previous attempts at branching you went wrong.
#2: I also see nothing in the script that matches any "brand selection", i.e. something resembling

Selection of the competing brand needs to be done based on survey questions. These questions have branching as well:
Q1: answers -> a-g. Answers a,b,c,f,g go to Q2, answers d and e go to the brand association task for competitor HR
Q2: answer a -> competitor HH
       answer b -> competitor HvA
       answer c -> competitor HR
       answer d-> Q3

Q3: answer a -> competitor HH
       answer b -> competitor HvA
       answer c -> competitor HR
       answer d-> competitor HR"

Where is that code?

#3: The script seems incomplete in other ways:

<expt>
...
/ blocks = [1 = demographicsselect; 2 = HHPracticeAssociationStrength; 3 = HHAssociationStrength; 4 = surveypage.demographics2; 5 = demographics3; 6 = ]
</expt>

Where and what is block #6?

#4: If you have code that relies on any external files to run (e.g. images), please always provide those files as well. The script alone is of limited use.

Thanks.

MichelleSnelleman
MichelleSnelleman
Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)
Group: Forum Members
Posts: 6, Visits: 13

Dear Dave, 

My apologies for providing incomplete code. Attached is the complete code including all brands and coding for branching. Picture stimuli were also added as attachment.

Kind regards,
Michelle
Attachments
hhs_nl_groen_fc-2018.jpg (315 views, 19.00 KB)
Inholland_Monogram_D_Magenta.png (316 views, 16.00 KB)
HvA_logo.png (348 views, 4.00 KB)
BRT_DEF.iqx (322 views, 42.00 KB)
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
MichelleSnelleman - 6/5/2019

Dear Dave, 

My apologies for providing incomplete code. Attached is the complete code including all brands and coding for branching. Picture stimuli were also added as attachment.

Kind regards,
Michelle

Thanks for the code.

The branching doesn't work for several reasons.

#1: Your /branch attributes are in the wrong place altogether. You cannot /branch from survey *question* elements (e.g. <radiobuttons>):

<radiobuttons huidigeopleiding>
/ caption = "Welke opleiding volg je nu?"
/ options = ("havo", "vwo", "mbo", "Hogeschool Rotterdam opleiding Communicatie", "Inholland opleiding Creative Business", "Inholland opleiding Communicatie","Ik volg op dit moment geen opleiding","Ik volg een andere opleiding")
/ branch = [
if (trial.huidigeopleiding="havo", "vwo", "mbo","Ik volg op dit moment geen opleiding","Ik volg een andere opleiding") trial.hogeschooloverwogen)
if (trial.huidigeopleiding="Hogeschool Rotterdam opleiding Communicatie", "Inholland opleiding Creative Business") expt.HR
]
</radiobuttons>

/branch attributes ought to reside at the <surveypage>, <trial>, <survey>, or <block> level.

#2: The /branch syntax is all wrong.
- A <radiobuttons> element is not a trial.
- trial.huidigeopleiding would return nothing anyway
- "havo", "vwo", "mbo","Ik volg op dit moment geen opleiding","Ik volg een andere opleiding" is not how a response would look.

#3: You cannot /branch to <expt> elements.

#4: A /branch must remain at the same level: a <trial> can /branch to another <trial>. A <block> can /branch to another <block>. A <trial> cannot /branch to a <block>. A <block> cannot /branch to a <trial>.
(Note that a <surveypage> is a kind of <trial> and a <survey> is a kind of <block>, i.e. a <surveypage> can /branch to a <trial> and vice versa. A <survey> can /branch to a <block> and vice versa.)

#5: You're also trying to run <surveypage>s via the <expt>s' /blocks. That won't work. As explained above, a <surveypage> is a <trial>, not a <block>. You need to set up <block> or <survey> elements to execute the surveypages and then run those blocks/surveys.

What you'll want to do is have ONE <expt> element in the script, like this:

<expt>
/ onexptbegin = [

values.responsekey_yes = parameters.responsekey_left;
values.responsekeyyes_label = parameters.responsekeyleft_label;
values.responsekey_no = parameters.responsekey_right;
values.responsekeyno_label = parameters.responsekeyright_label;
values.yes_x = parameters.left_x;
values.no_x = parameters.right_x;
values.yesresponse = "LEFT";
values.noresponse = "RIGHT";
]

/ postinstructions = (End)
/ onexptend = [values.completed = 1]
/ blocks = [1 = demographicsselect]
</expt>

Then, from <block demographicsselect> /branch to the applicable condition <block> based on the response to the selection questions. From there, you can /branch to the other blocks for the selected school unconditionally.



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
Dave - 6/5/2019
MichelleSnelleman - 6/5/2019

Dear Dave, 

My apologies for providing incomplete code. Attached is the complete code including all brands and coding for branching. Picture stimuli were also added as attachment.

Kind regards,
Michelle

Thanks for the code.

The branching doesn't work for several reasons.

#1: Your /branch attributes are in the wrong place altogether. You cannot /branch from survey *question* elements (e.g. <radiobuttons>):

<radiobuttons huidigeopleiding>
/ caption = "Welke opleiding volg je nu?"
/ options = ("havo", "vwo", "mbo", "Hogeschool Rotterdam opleiding Communicatie", "Inholland opleiding Creative Business", "Inholland opleiding Communicatie","Ik volg op dit moment geen opleiding","Ik volg een andere opleiding")
/ branch = [
if (trial.huidigeopleiding="havo", "vwo", "mbo","Ik volg op dit moment geen opleiding","Ik volg een andere opleiding") trial.hogeschooloverwogen)
if (trial.huidigeopleiding="Hogeschool Rotterdam opleiding Communicatie", "Inholland opleiding Creative Business") expt.HR
]
</radiobuttons>

/branch attributes ought to reside at the <surveypage>, <trial>, <survey>, or <block> level.

#2: The /branch syntax is all wrong.
- A <radiobuttons> element is not a trial.
- trial.huidigeopleiding would return nothing anyway
- "havo", "vwo", "mbo","Ik volg op dit moment geen opleiding","Ik volg een andere opleiding" is not how a response would look.

#3: You cannot /branch to <expt> elements.

#4: A /branch must remain at the same level: a <trial> can /branch to another <trial>. A <block> can /branch to another <block>. A <trial> cannot /branch to a <block>. A <block> cannot /branch to a <trial>.
(Note that a <surveypage> is a kind of <trial> and a <survey> is a kind of <block>, i.e. a <surveypage> can /branch to a <trial> and vice versa. A <survey> can /branch to a <block> and vice versa.)

#5: You're also trying to run <surveypage>s via the <expt>s' /blocks. That won't work. As explained above, a <surveypage> is a <trial>, not a <block>. You need to set up <block> or <survey> elements to execute the surveypages and then run those blocks/surveys.

What you'll want to do is have ONE <expt> element in the script, like this:

<expt>
/ onexptbegin = [

values.responsekey_yes = parameters.responsekey_left;
values.responsekeyyes_label = parameters.responsekeyleft_label;
values.responsekey_no = parameters.responsekey_right;
values.responsekeyno_label = parameters.responsekeyright_label;
values.yes_x = parameters.left_x;
values.no_x = parameters.right_x;
values.yesresponse = "LEFT";
values.noresponse = "RIGHT";
]

/ postinstructions = (End)
/ onexptend = [values.completed = 1]
/ blocks = [1 = demographicsselect]
</expt>

Then, from <block demographicsselect> /branch to the applicable condition <block> based on the response to the selection questions. From there, you can /branch to the other blocks for the selected school unconditionally.



Here's a simplified example that should give you the general idea:

<expt>
/ blocks = [1=select_school]
</expt>

<block select_school>
/ trials = [1=selectionpage]
/ branch = [
if (radiobuttons.selectionquestion.response == "School A") block.School_A_Block_1
else if (radiobuttons.selectionquestion.response == "School B") block.School_B_Block_1
else if (radiobuttons.selectionquestion.response == "School C") block.School_C_Block_1;
]
</block>

<surveypage selectionpage>
/ questions = [1=selectionquestion]
</surveypage>

<radiobuttons selectionquestion>
/ caption = "Please select your school"
/ options = ("School A", "School B", "School C")
</radiobuttons>

// School A
<block School_A_Block_1>
/ trials = [1=exampletrial]
/ branch = [
block.School_A_Block_2
]
</block>

<block School_A_Block_2>
/ trials = [1=exampletrial]
/ branch = [
block.School_A_Block_3
]
</block>

<block School_A_Block_3>
/ trials = [1=exampletrial]
</block>

// School B
<block School_B_Block_1>
/ trials = [1=exampletrial]
/ branch = [
block.School_B_Block_2
]
</block>

<block School_B_Block_2>
/ trials = [1=exampletrial]
/ branch = [
block.School_B_Block_3
]
</block>

<block School_B_Block_3>
/ trials = [1=exampletrial]
</block>

// School C
<block School_C_Block_1>
/ trials = [1=exampletrial]
/ branch = [
block.School_C_Block_2
]
</block>

<block School_C_Block_2>
/ trials = [1=exampletrial]
/ branch = [
block.School_C_Block_3
]
</block>

<block School_C_Block_3>
/ trials = [1=exampletrial]
</block>

<trial exampletrial>
/ stimulusframes = [1=exampletext]
/ validresponse = (57)
/ timeout = 5000
</trial>

<text exampletext>
/ items = ("This is <%script.currentblock%>")
</text>



MichelleSnelleman
MichelleSnelleman
Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)
Group: Forum Members
Posts: 6, Visits: 13

Dear Dave,

Thanks for your elaborate and clear response. I've adjusted my script accordingly but I still encounter some errors. I'm not sure what I'm doing wrong.
I've attached the adjusted script and stimuli for your reference.

Thanks again!

Kind regards, 
Michelle
Attachments
voorbeeldsript forum.iqx (302 views, 35.00 KB)
hhs_nl_groen_fc-2018.jpg (315 views, 19.00 KB)
HvA_logo.png (297 views, 4.00 KB)
Inholland_Hogeschool_Magenta.png (293 views, 22.00 KB)
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
MichelleSnelleman - 6/5/2019

Dear Dave,

Thanks for your elaborate and clear response. I've adjusted my script accordingly but I still encounter some errors. I'm not sure what I'm doing wrong.
I've attached the adjusted script and stimuli for your reference.

Thanks again!

Kind regards, 
Michelle

<trial INHPracticeBrand>
/ ontrialbegin = [
trial.INHPracticeBrand.insertstimulustime(clearscreen, parameters.brandduration);
trial.INHPracticeBrand.insertstimulustime(text.INHPractice_association, parameters.brandduration);
trial.INHPracticeBrand.insertstimulustime(text.yes, parameters.brandduration);
trial.INHPracticeBrand.insertstimulustime(text.no, parameters.brandduration);
]
/ stimulustimes = [0 = INHPracticebrand]
/ beginresponsetime = parameters.brandduration
/ responseinterrupt = immediate
/ validresponse = (parameters.responsekey_left, parameters.responsekey_right)
/ ontrialend = [
if (trial.INHPracticeBrand.response == values.responsekey_yes)
values.response = "PAST WEL"
else
values.response = "PAST NIET";
values.brand = picture.INHPracticebrand.currentitem;
values.association = text.INHPractice_association.currentitem;
trial.INHPracticeBrand.resetstimulusframes();
]
/ posttrialpause = parameters.iti
</trial>

There is no <picture> element called "INHPracticebrand" anywhere in the script.

<trial HHPracticeBrand>
/ ontrialbegin = [
trial.HHPracticeBrand.insertstimulustime(clearscreen, parameters.brandduration);
trial.HHPracticeBrand.insertstimulustime(text.HH_practice_association, parameters.brandduration);
trial.HHPracticeBrand.insertstimulustime(text.yes, parameters.brandduration);
trial.HHPracticeBrand.insertstimulustime(text.no, parameters.brandduration);
]
/ stimulustimes = [0 = HHPractice]
/ beginresponsetime = parameters.brandduration
/ responseinterrupt = immediate
/ validresponse = (parameters.responsekey_left, parameters.responsekey_right)
/ ontrialend = [
if (trial.HHPracticeBrand.response == values.responsekey_yes)
values.response = "PAST WEL"
else
values.response = "PAST NIET";
values.brand = picture.PracticeBrand2.currentitem;
values.association = text.HHPractice_association.currentitem;
trial.HHPracticeBrand.resetstimulusframes();
]
/ posttrialpause = parameters.iti
</trial>

There is no <picture> element called "PracticeBrand2" anywhere in the script.

<trial HRPracticeBrand>
/ ontrialbegin = [
trial.HRPracticeBrand.insertstimulustime(clearscreen, parameters.brandduration);
trial.HRPracticeBrand.insertstimulustime(text.HRPractice_association, parameters.brandduration);
trial.HRPracticeBrand.insertstimulustime(text.yes, parameters.brandduration);
trial.HRPracticeBrand.insertstimulustime(text.no, parameters.brandduration);
]
/ stimulustimes = [0 = PracticeBrand3]
/ beginresponsetime = parameters.brandduration
/ responseinterrupt = immediate
/ validresponse = (parameters.responsekey_left, parameters.responsekey_right)
/ ontrialend = [
if (trial.HRPracticeBrand.response == values.responsekey_yes)
values.response = "PAST WEL"
else
values.response = "PAST NIET";
values.brand = picture.PracticeBrand3.currentitem;
values.association = text.PracticeBrand3association.currentitem;
trial.HRPracticeBrand.resetstimulusframes();
]
/ posttrialpause = parameters.iti
</trial>

There is no <picture> element called "PracticeBrand3" anywhere in the script.

<trial HVAPractice>
/ ontrialbegin = [
trial.HVAPractice.insertstimulustime(clearscreen, parameters.brandduration);
trial.HVAPractice.insertstimulustime(text.HvAPractice_association, parameters.brandduration);
trial.HVAPractice.insertstimulustime(text.yes, parameters.brandduration);
trial.HVAPractice.insertstimulustime(text.no, parameters.brandduration);
]
/ stimulustimes = [0 = PHVAPractice]
/ beginresponsetime = parameters.brandduration
/ responseinterrupt = immediate
/ validresponse = (parameters.responsekey_left, parameters.responsekey_right)
/ ontrialend = [
if (trial.HVAPractice.response == values.responsekey_yes)
values.response = "PAST WEL"
else
values.response = "PAST NIET";
values.brand = picture.PracticeBrand4.currentitem;
values.association = text.PracticeBrand4association.currentitem;
trial.HVAPractice.resetstimulusframes();
]
/ posttrialpause = parameters.iti
</trial>

There is no stimulus element called "PHVAPractice" anywhere in the script.
There is no <picture> element called "PracticeBrand4" anywhere in the script.

<block HHAssociationStrength>
/ trials = [1 = instructions; 2-87 = noreplace(Merk1, Merk2)]
/ branch = [ survey.HHvragen
]
</block>

<block HHPracticeAssociationStrength>
/ trials = [1 = instructions; 2-9 = noreplace(PracticeBrand1, PracticeBrand2)]
/ branch = [
block.HHAssociationStrength
]
</block>

<block HRAssociationStrength>
/ trials = [1 = instructions; 2-87 = noreplace(Merk1)]
/ branch = [
survey.HRvragen
]
</block>

<block HRPracticeAssociationStrength>
/ trials = [1 = instructions; 2-9 = noreplace(PracticeBrand1, PracticeBrand3)]
/ branch = [
block.HRAssociationStrength
]
</block>

<block HvAAssociationStrength>
/ trials = [1 = instructions; 2-87 = noreplace(Merk1, Merk4)]
/ branch = [
survey.HVAvragen
]
</block>

<block HvAPracticeAssociationStrength>
/ trials = [1 = instructions; 2-9 = noreplace(PracticeBrand1, PracticeBrand4)]
/ branch = [
block.HvAAssociationStrength
]
</block>

There are no <trial> elements called PracticeBrand1, PracticeBrand2, PracticeBrand3, PracticeBrand4, Merk1, Merk3 and Merk4 anywhere in the script.

<block select_3>
/ trials = [1=surveypage.select3]
/ branch = [
if (radiobuttons.kenanderehogeschool.response == "Haagse Hogeschool") block.HHPracticeAssociationStrength
else if (radiobuttons.kenanderehogeschool.response == "Hogeschool Rotterdam"; "geen van bovenstaande") block.HRPracticeAssociationStrength
else if (radiobuttons.kenanderehogeschool.response == "Hogeschool van Amsterdam") block.HvAPracticeAssociationStrength;
]
</block>

This is not valid syntax. It ought to read

else if (radiobuttons.kenanderehogeschool.response == "Hogeschool Rotterdam" || radiobuttons.kenanderehogeschool.response == "geen van bovenstaande") block.HRPracticeAssociationStrength

<text instructions>
/ items = instructions
/ select = sequence
/ size = (100%, 80%)
/ vjustify = center
/ hjustify = center
/ fontstyle = ("Arial", 3%, true, false, false, false, 5, 1)
/ resetinterval = 0
</text>

There is no <item> element called "instructions" anywhere in the script.

MichelleSnelleman
MichelleSnelleman
Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)Respected Member (359 reputation)
Group: Forum Members
Posts: 6, Visits: 13

Dear Dave,

Thanks very much for your feedback, everything is running great now!
 One final question: when running the script on Inquisit web, at first everything was ok but today I ran a test trial and the answers for the selection question were displayed as symbols, not as letters on Windows 10 pc, not on Macbook or iPhone. I did not change the script between the first and second test run. Is there an explanation for this?

Kind regards,
Michelle
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search