Relabeling picture stimuli


Author
Message
vicki.rivera
vicki.rivera
Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)
Group: Forum Members
Posts: 10, Visits: 30
Hi! 
I have designed a survey where participants use photo buttons to reply on a scale from 1-7. I was wondering if there was any way to assign a numerical value to these image stimuli instead of just seeing the name of the image when the data is recorded. So for example, instead of having it recorded that the participant selected "button," I want it to record whether they selected 1, 2, 3, etc.
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
vicki.rivera - 10/22/2024
Hi! 
I have designed a survey where participants use photo buttons to reply on a scale from 1-7. I was wondering if there was any way to assign a numerical value to these image stimuli instead of just seeing the name of the image when the data is recorded. So for example, instead of having it recorded that the participant selected "button," I want it to record whether they selected 1, 2, 3, etc.

Post example code. How to do this cannot be answered without seeing how you've set things up.
vicki.rivera
vicki.rivera
Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)
Group: Forum Members
Posts: 10, Visits: 30
Dave - 10/22/2024
vicki.rivera - 10/22/2024
Hi! 
I have designed a survey where participants use photo buttons to reply on a scale from 1-7. I was wondering if there was any way to assign a numerical value to these image stimuli instead of just seeing the name of the image when the data is recorded. So for example, instead of having it recorded that the participant selected "button," I want it to record whether they selected 1, 2, 3, etc.

Post example code. How to do this cannot be answered without seeing how you've set things up.

Here's an example: 

<picture 6pointbutton1>
/ items = ("1.jpg")
/ position = (10%, 60%)
/ size = (5%, 5%)
/ erase = false
</picture>

<trial sexistattitudes>
/ stimulusframes = [1=sexist_attitude_question, 6pointscale, 6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6,
6pointagree1, 6pointagree2, 6pointagree3, 6pointagree4, 6pointagree5, 6pointagree6]
/ validresponse = (6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6)
/ inputdevice = mouse
</trial>

My initial thought was to change the names of the buttons. However, I have different scales that are using the same image buttons (for example a 9 point scale and a 5 point scale), so I don't think that would work. 
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
vicki.rivera - 10/22/2024
Dave - 10/22/2024
vicki.rivera - 10/22/2024
Hi! 
I have designed a survey where participants use photo buttons to reply on a scale from 1-7. I was wondering if there was any way to assign a numerical value to these image stimuli instead of just seeing the name of the image when the data is recorded. So for example, instead of having it recorded that the participant selected "button," I want it to record whether they selected 1, 2, 3, etc.

Post example code. How to do this cannot be answered without seeing how you've set things up.

Here's an example: 

<picture 6pointbutton1>
/ items = ("1.jpg")
/ position = (10%, 60%)
/ size = (5%, 5%)
/ erase = false
</picture>

<trial sexistattitudes>
/ stimulusframes = [1=sexist_attitude_question, 6pointscale, 6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6,
6pointagree1, 6pointagree2, 6pointagree3, 6pointagree4, 6pointagree5, 6pointagree6]
/ validresponse = (6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6)
/ inputdevice = mouse
</trial>

My initial thought was to change the names of the buttons. However, I have different scales that are using the same image buttons (for example a 9 point scale and a 5 point scale), so I don't think that would work. 

Okay, and if, say, 6pointbutton3 is clicked, you want a variable in the data file that says 3 -- correc?
Edited 2 Months Ago by Dave
vicki.rivera
vicki.rivera
Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)
Group: Forum Members
Posts: 10, Visits: 30
Dave - 10/22/2024
vicki.rivera - 10/22/2024
Dave - 10/22/2024
vicki.rivera - 10/22/2024
Hi! 
I have designed a survey where participants use photo buttons to reply on a scale from 1-7. I was wondering if there was any way to assign a numerical value to these image stimuli instead of just seeing the name of the image when the data is recorded. So for example, instead of having it recorded that the participant selected "button," I want it to record whether they selected 1, 2, 3, etc.

Post example code. How to do this cannot be answered without seeing how you've set things up.

Here's an example: 

<picture 6pointbutton1>
/ items = ("1.jpg")
/ position = (10%, 60%)
/ size = (5%, 5%)
/ erase = false
</picture>

<trial sexistattitudes>
/ stimulusframes = [1=sexist_attitude_question, 6pointscale, 6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6,
6pointagree1, 6pointagree2, 6pointagree3, 6pointagree4, 6pointagree5, 6pointagree6]
/ validresponse = (6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6)
/ inputdevice = mouse
</trial>

My initial thought was to change the names of the buttons. However, I have different scales that are using the same image buttons (for example a 9 point scale and a 5 point scale), so I don't think that would work. 

Okay, and if, say, 6pointbutton3 is clicked, you want a variable in the data file that says 3 -- correct

Yes, that's correct!
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
vicki.rivera - 10/22/2024
Dave - 10/22/2024
vicki.rivera - 10/22/2024
Dave - 10/22/2024
vicki.rivera - 10/22/2024
Hi! 
I have designed a survey where participants use photo buttons to reply on a scale from 1-7. I was wondering if there was any way to assign a numerical value to these image stimuli instead of just seeing the name of the image when the data is recorded. So for example, instead of having it recorded that the participant selected "button," I want it to record whether they selected 1, 2, 3, etc.

Post example code. How to do this cannot be answered without seeing how you've set things up.

Here's an example: 

<picture 6pointbutton1>
/ items = ("1.jpg")
/ position = (10%, 60%)
/ size = (5%, 5%)
/ erase = false
</picture>

<trial sexistattitudes>
/ stimulusframes = [1=sexist_attitude_question, 6pointscale, 6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6,
6pointagree1, 6pointagree2, 6pointagree3, 6pointagree4, 6pointagree5, 6pointagree6]
/ validresponse = (6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6)
/ inputdevice = mouse
</trial>

My initial thought was to change the names of the buttons. However, I have different scales that are using the same image buttons (for example a 9 point scale and a 5 point scale), so I don't think that would work. 

Okay, and if, say, 6pointbutton3 is clicked, you want a variable in the data file that says 3 -- correct

Yes, that's correct!

That's trilvial to do then. Simply substring() the final character of the response property, which will be the number, store in a value, log the value.

<values>
/ buttonValue = null
</values>

<block exampleBlock>
/ trials = [1-10 = trial.exampleTrial]
</block>

<trial exampleTrial>
/ ontrialend = [
    values.buttonValue = substring(trial.exampleTrial.response, length(trial.exampleTrial.response)-1, 1);
]
/ stimulusframes = [1=6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6]
/ validresponse = (6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6)
/ inputdevice = mouse
</trial>

<text 6pointbutton1>
/ items = ("1.jpg")
/ position = (10%, 60%)
/ size = (5%, 5%)
</text>

<text 6pointbutton2>
/ items = ("2.jpg")
/ position = (26%, 60%)
/ size = (5%, 5%)
</text>

<text 6pointbutton3>
/ items = ("3.jpg")
/ position = (42%, 60%)
/ size = (5%, 5%)
</text>

<text 6pointbutton4>
/ items = ("4.jpg")
/ position = (58%, 60%)
/ size = (5%, 5%)
</text>

<text 6pointbutton5>
/ items = ("5.jpg")
/ position = (74%, 60%)
/ size = (5%, 5%)
</text>

<text 6pointbutton6>
/ items = ("6.jpg")
/ position = (90%, 60%)
/ size = (5%, 5%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode response values.buttonValue latency correct)
</data>

vicki.rivera
vicki.rivera
Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)Associate Member (52 reputation)
Group: Forum Members
Posts: 10, Visits: 30
Dave - 10/22/2024
vicki.rivera - 10/22/2024
Dave - 10/22/2024
vicki.rivera - 10/22/2024
Dave - 10/22/2024
vicki.rivera - 10/22/2024
Hi! 
I have designed a survey where participants use photo buttons to reply on a scale from 1-7. I was wondering if there was any way to assign a numerical value to these image stimuli instead of just seeing the name of the image when the data is recorded. So for example, instead of having it recorded that the participant selected "button," I want it to record whether they selected 1, 2, 3, etc.

Post example code. How to do this cannot be answered without seeing how you've set things up.

Here's an example: 

<picture 6pointbutton1>
/ items = ("1.jpg")
/ position = (10%, 60%)
/ size = (5%, 5%)
/ erase = false
</picture>

<trial sexistattitudes>
/ stimulusframes = [1=sexist_attitude_question, 6pointscale, 6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6,
6pointagree1, 6pointagree2, 6pointagree3, 6pointagree4, 6pointagree5, 6pointagree6]
/ validresponse = (6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6)
/ inputdevice = mouse
</trial>

My initial thought was to change the names of the buttons. However, I have different scales that are using the same image buttons (for example a 9 point scale and a 5 point scale), so I don't think that would work. 

Okay, and if, say, 6pointbutton3 is clicked, you want a variable in the data file that says 3 -- correct

Yes, that's correct!

That's trilvial to do then. Simply substring() the final character of the response property, which will be the number, store in a value, log the value.

<values>
/ buttonValue = null
</values>

<block exampleBlock>
/ trials = [1-10 = trial.exampleTrial]
</block>

<trial exampleTrial>
/ ontrialend = [
    values.buttonValue = substring(trial.exampleTrial.response, length(trial.exampleTrial.response)-1, 1);
]
/ stimulusframes = [1=6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6]
/ validresponse = (6pointbutton1, 6pointbutton2, 6pointbutton3, 6pointbutton4, 6pointbutton5, 6pointbutton6)
/ inputdevice = mouse
</trial>

<text 6pointbutton1>
/ items = ("1.jpg")
/ position = (10%, 60%)
/ size = (5%, 5%)
</text>

<text 6pointbutton2>
/ items = ("2.jpg")
/ position = (26%, 60%)
/ size = (5%, 5%)
</text>

<text 6pointbutton3>
/ items = ("3.jpg")
/ position = (42%, 60%)
/ size = (5%, 5%)
</text>

<text 6pointbutton4>
/ items = ("4.jpg")
/ position = (58%, 60%)
/ size = (5%, 5%)
</text>

<text 6pointbutton5>
/ items = ("5.jpg")
/ position = (74%, 60%)
/ size = (5%, 5%)
</text>

<text 6pointbutton6>
/ items = ("6.jpg")
/ position = (90%, 60%)
/ size = (5%, 5%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode response values.buttonValue latency correct)
</data>

That's super helpful, thank you!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search