Millisecond Forums

Radiobutton question

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

By Libra - 5/13/2021

Hi, 
I want to have a trial where two pictures are presented side by side and then participants will be asked to choose either the left one or the right one. 
The pictures being presented on the left or the right side of the screen will be counterbalanced across participants. I was able to do this. 
But I wonder if it is possible to 
(1) present the pictures first and the question will show up later, so that participants can look at the pictures first without being disturbed by the question. 

(2) record participants' responses so that I could easily know which picture they chose. (If I only know they chose the left picture or the right picture, I won't know if the left picture they saw was picture 1 or picture 2, due to the randomization of presentation side.)

Below is the code I have so far. Thank you so much!

<block Scholarship>
/ preinstructions = (Scholarship_instruction1,Scholarship_instruction2)
/ trials=[1=nonsexualcandidates]
</block>

<page Scholarship_instruction1>
^blablabla
</page>

<page Scholarship_instruction2>
^blablablablabla
</page>

<surveypage nonsexualcandidates>
/ stimulustimes = [0 = CandidateAtext,CandidateBtext,CandidateApicture,CandidateBpicture]
/ questions=[1=CandidateABchoice]
/showpagenumbers = false
/showquestionnumbers = false
/ nextlabel = "continue"
/ finishlabel = "continue" 
</surveypage>

<text CandidateAtext>
/ items = ("Candidate A")
/ position = (25,10)
</text>

<text CandidateBtext>
/ items = ("Candidate B")
/ position = (75,10)
</text>

<picture CandidateApicture>
/ items= ("Non_female_1.jpg","Non_male_1.jpg")
/ select=CandidateAselected
/ position=(25,40)
</picture>

<picture CandidateBpicture>
/ items= ("Non_female_1.jpg","Non_male_1.jpg")
/ select=CandidateBselected
/ position=(75,40)
</picture>

<counter CandidateAselected>
/select=replace(1-2)
</counter>

<counter CandidateBselected>
/select=replace(1-2)
/not=(CandidateAselected)
</counter>

<radiobuttons CandidateABchoice>
/ caption="If you have to choose between Candidate A and Candidate B, whom would you choose? "
/ options = ("Candidate A","Candidate B")
/ position = (10,70)
/ orientation=horizontalequal
</radiobuttons>
By Dave - 5/13/2021

Libra - 5/13/2021
Hi, 
I want to have a trial where two pictures are presented side by side and then participants will be asked to choose either the left one or the right one. 
The pictures being presented on the left or the right side of the screen will be counterbalanced across participants. I was able to do this. 
But I wonder if it is possible to 
(1) present the pictures first and the question will show up later, so that participants can look at the pictures first without being disturbed by the question. 

(2) record participants' responses so that I could easily know which picture they chose. (If I only know they chose the left picture or the right picture, I won't know if the left picture they saw was picture 1 or picture 2, due to the randomization of presentation side.)

Below is the code I have so far. Thank you so much!

<block Scholarship>
/ preinstructions = (Scholarship_instruction1,Scholarship_instruction2)
/ trials=[1=nonsexualcandidates]
</block>

<page Scholarship_instruction1>
^blablabla
</page>

<page Scholarship_instruction2>
^blablablablabla
</page>

<surveypage nonsexualcandidates>
/ stimulustimes = [0 = CandidateAtext,CandidateBtext,CandidateApicture,CandidateBpicture]
/ questions=[1=CandidateABchoice]
/showpagenumbers = false
/showquestionnumbers = false
/ nextlabel = "continue"
/ finishlabel = "continue" 
</surveypage>

<text CandidateAtext>
/ items = ("Candidate A")
/ position = (25,10)
</text>

<text CandidateBtext>
/ items = ("Candidate B")
/ position = (75,10)
</text>

<picture CandidateApicture>
/ items= ("Non_female_1.jpg","Non_male_1.jpg")
/ select=CandidateAselected
/ position=(25,40)
</picture>

<picture CandidateBpicture>
/ items= ("Non_female_1.jpg","Non_male_1.jpg")
/ select=CandidateBselected
/ position=(75,40)
</picture>

<counter CandidateAselected>
/select=replace(1-2)
</counter>

<counter CandidateBselected>
/select=replace(1-2)
/not=(CandidateAselected)
</counter>

<radiobuttons CandidateABchoice>
/ caption="If you have to choose between Candidate A and Candidate B, whom would you choose? "
/ options = ("Candidate A","Candidate B")
/ position = (10,70)
/ orientation=horizontalequal
</radiobuttons>

> (1) present the pictures first and the question will show up later, so that participants can look at the pictures first without being disturbed by the question.

Set up a <trial> that displays the two pictures, from there /branch to the surveypage with your question.

> (2) record participants' responses so that I could easily know which picture they chose. (If I only know they chose the left picture or the right picture, I won't know if the left picture they saw was picture 1 or picture 2, due to the randomization of presentation side.)

I don't understand this question. You should have everything you need to make that determination in the data file.

Beyond that, whenever you must share code that requires external files to run (here: a few images), provide all necessary files, please.
By Dave - 5/13/2021

Dave - 5/13/2021
Libra - 5/13/2021
Hi, 
I want to have a trial where two pictures are presented side by side and then participants will be asked to choose either the left one or the right one. 
The pictures being presented on the left or the right side of the screen will be counterbalanced across participants. I was able to do this. 
But I wonder if it is possible to 
(1) present the pictures first and the question will show up later, so that participants can look at the pictures first without being disturbed by the question. 

(2) record participants' responses so that I could easily know which picture they chose. (If I only know they chose the left picture or the right picture, I won't know if the left picture they saw was picture 1 or picture 2, due to the randomization of presentation side.)

Below is the code I have so far. Thank you so much!

<block Scholarship>
/ preinstructions = (Scholarship_instruction1,Scholarship_instruction2)
/ trials=[1=nonsexualcandidates]
</block>

<page Scholarship_instruction1>
^blablabla
</page>

<page Scholarship_instruction2>
^blablablablabla
</page>

<surveypage nonsexualcandidates>
/ stimulustimes = [0 = CandidateAtext,CandidateBtext,CandidateApicture,CandidateBpicture]
/ questions=[1=CandidateABchoice]
/showpagenumbers = false
/showquestionnumbers = false
/ nextlabel = "continue"
/ finishlabel = "continue" 
</surveypage>

<text CandidateAtext>
/ items = ("Candidate A")
/ position = (25,10)
</text>

<text CandidateBtext>
/ items = ("Candidate B")
/ position = (75,10)
</text>

<picture CandidateApicture>
/ items= ("Non_female_1.jpg","Non_male_1.jpg")
/ select=CandidateAselected
/ position=(25,40)
</picture>

<picture CandidateBpicture>
/ items= ("Non_female_1.jpg","Non_male_1.jpg")
/ select=CandidateBselected
/ position=(75,40)
</picture>

<counter CandidateAselected>
/select=replace(1-2)
</counter>

<counter CandidateBselected>
/select=replace(1-2)
/not=(CandidateAselected)
</counter>

<radiobuttons CandidateABchoice>
/ caption="If you have to choose between Candidate A and Candidate B, whom would you choose? "
/ options = ("Candidate A","Candidate B")
/ position = (10,70)
/ orientation=horizontalequal
</radiobuttons>

> (1) present the pictures first and the question will show up later, so that participants can look at the pictures first without being disturbed by the question.

Set up a <trial> that displays the two pictures, from there /branch to the surveypage with your question.

> (2) record participants' responses so that I could easily know which picture they chose. (If I only know they chose the left picture or the right picture, I won't know if the left picture they saw was picture 1 or picture 2, due to the randomization of presentation side.)

I don't understand this question. You should have everything you need to make that determination in the data file.

Beyond that, whenever you must share code that requires external files to run (here: a few images), provide all necessary files, please.

Here's a basic revision of the code:

<block Scholarship>
/ preinstructions = (Scholarship_instruction1,Scholarship_instruction2)
/ trials=[1=nonsexualcandidates_show]
</block>

<page Scholarship_instruction1>
^blablabla
</page>

<page Scholarship_instruction2>
^blablablablabla
</page>

<surveypage nonsexualcandidates_show>
/ ontrialbegin = [
    values.a = list.candidateitems.nextindex;
    values.b = list.candidateitems.nextindex;
    values.selected_image = "";
]
/ stimulustimes = [0 = CandidateAtext,CandidateBtext,CandidateApicture,CandidateBpicture]
/showpagenumbers = false
/showquestionnumbers = false
/ nextlabel = "continue"
/ finishlabel = "continue"
/ branch = [
    surveypage.nonsexualcandidates_question;
]
</surveypage>

<surveypage nonsexualcandidates_question>
/ ontrialend = [
    if (radiobuttons.CandidateABchoice.response == "Candidate A") {
        values.selected_image = picture.CandidateApicture.currentitem;
    } else if (radiobuttons.CandidateABchoice.response == "Candidate B"){
        values.selected_image = picture.CandidateBpicture.currentitem;
    };
]
/ stimulustimes = [0 = CandidateAtext,CandidateBtext,CandidateApicture,CandidateBpicture]
/ questions=[1=CandidateABchoice]
/showpagenumbers = false
/showquestionnumbers = false
/ nextlabel = "continue"
/ finishlabel = "continue"
</surveypage>

<text CandidateAtext>
/ items = ("Candidate A")
/ position = (25,10)
</text>

<text CandidateBtext>
/ items = ("Candidate B")
/ position = (75,10)
</text>

<values>
/ a = 1
/ b = 1
/ selected_image = ""
</values>

<list candidateitems>
/ poolsize = 2
/ selectionrate = always
</list>

<picture CandidateApicture>
/ items= ("Non_female_1.jpg","Non_male_1.jpg")
/ select=values.a
/ position=(25,40)
</picture>

<picture CandidateBpicture>
/ items= ("Non_female_1.jpg","Non_male_1.jpg")
/ select=values.b
/ position=(75,40)
</picture>

<radiobuttons CandidateABchoice>
/ caption="If you have to choose between Candidate A and Candidate B, whom would you choose? "
/ options = ("Candidate A","Candidate B")
/ position = (10,70)
/ orientation=horizontalequal
</radiobuttons>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode stimulusitem stimulusitem stimulusitem stimulusitem
    values.a values.b response values.selected_image latency correct)
</data>
By Libra - 5/13/2021

Thank you so much! It helped a lot