Millisecond Online Community

Problem with radiobuttons.q1.response

rated by 0 users
This post has 7 Replies | 2 Followers

Top 150 Contributor
Posts 9
Michael Weiksner Posted: 08-31-2008 7:00 PM
I think I may have uncovered a bug in the response part of radiobuttons.  When I run the following script, it will correctly tell me which stimuli I picked in the second trial but it won't report back what I picked in the radiobutton. In fact, none of the survey stuff seems to work (options, optionvalue and also dropdown, etc.)

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

<block stuff>
/ trials = [1=florida_ed2; 2=choices; 3=some]
</block>
<surveypage florida_ed2>
/ caption = "Please answer the following demographic questions (continued)"
/ questions = [1=florida_ed1]
</surveypage>

<trial some>
/ inputdevice = mouse
/ stimulusframes = [1=sometext]
/ validresponse = (sometext)
</trial>

<text sometext>
/ items= ("response = <% radiobuttons.florida_ed1.response %>; trial=<% trial.choices.response %>")
</text>

<text choiceA>
/ items = ("Pick A")
/ size = (60%, 9%)
/ position = (50%,45%)
/ valign = bottom
/ txcolor = blue
</text>

<text choiceB>
/ items= ("Pick B")
/ size = (60%, 9%)
/ position = (50%, 55%)
/ valign = bottom
/ txcolor = blue
</text>

<trial choices>
/ stimulusframes = [1=choiceA, choiceB]
/ validresponse = (choiceA, choiceB)
/ inputdevice = mouse
</trial>

<radiobuttons florida_ed1>
/ fontstyle = ("Arial", 1.5%)
/ caption = "What was the last college that you attended in Florida?"
/ options = ("Barry University","Beacon College","Bethune-Cookman College","Eckerd College","Embry-Riddle","Flagler College",
"Florida A&M Law School","Florida A&M University","Florida Agriculture & Mechanical University","Florida Atlantic University",
"Florida Coastal School of Law","Florida Gulf Coast University","Florida Institute of Technology","Florida International University",
"Florida International University School of Law","Florida Southern College","Florida State University","New College of Florida",
"Nova Southeastern University","St Thomas University School of Law","Stetson University","University of Central Florida",
"University of Florida","University of Miami","University of North Florida","University of South Florida","University of West Florida")
</radiobuttons>

<data >
/ file = "C:"
</data>
Top 10 Contributor
Posts 2,340
I've also noticed this behavior described by Michael and I have some additional observations: The properties of survey questions appear to be inaccessible only when running them like standard trial elements (i.e. as part of the /trials listing in a <block> element). If - instead - you run the survey questions / pages from a <survey> element, all the properties can be accessed. Maybe this could be a temporary workaround for you, Michael? Here's some code to try out:

*** Survey Start ***

<survey florida_ed>
/pages = [1=florida_ed2; 2=checkresponse]
</survey>

<surveypage florida_ed2>
/ caption = "Please answer the following demographic questions (continued)"
/ questions = [1=florida_ed1]
</surveypage>

<radiobuttons florida_ed1>
/ fontstyle = ("Arial", 1.5%)
/ caption = "What was the last college that you attended in Florida?"
/ options = ("Barry University","Beacon College","Bethune-Cookman College","Eckerd College","Embry-Riddle","Flagler College",
"Florida A&M Law School","Florida A&M University","Florida Agriculture & Mechanical University","Florida Atlantic University",
"Florida Coastal School of Law","Florida Gulf Coast University","Florida Institute of Technology","Florida International University",
"Florida International University School of Law","Florida Southern College","Florida State University","New College of Florida",
"Nova Southeastern University","St Thomas University School of Law","Stetson University","University of Central Florida",
"University of Florida","University of Miami","University of North Florida","University of South Florida","University of West Florida")
</radiobuttons>

<surveypage checkresponse>
/ questions = [1=check]
</surveypage>

<caption check>
/ caption = "response = <% radiobuttons.florida_ed1.response %>"
</caption>

*** Survey End ***

Sean, is this behavior intended? In a related matter: I think it would be great to have separate properties for accessing response 'options' and 'optionvalues'. Specifying numerical '/ optionvalues' is great for data recording and analysis, but if you want to give participants feedback on some of their choices, a numerical value sometimes isn't what you want. To clarify:

<radiobuttons q1>
/ caption="Who was the first president of the United States:"
/ options=("George Washington", "Abraham Lincoln", "Thomas Jefferson")
</radiobuttons>

In this case <% radiobuttons.q1.response %> will give you "George Washington" (at least if the participant is reasonably smart...). But when setting

<radiobuttons q1>
/ caption="Who was the first president of the United States:"
/ options=("George Washington", "Abraham Lincoln", "Thomas Jefferson")
/ optionvalues=("1", "2", "3")
</radiobuttons>

<% radiobuttons.q1.response %>  will give you "1" with no (easy) way to retrieve the original response text "George Washington". I'd basically like to have both options at all times via different properties such as <% radiobuttons.q1.response %> for the response text and <% radiobuttons.q1.responsevalue %> for the associated numerical value. Any thoughts?

Best,
~Dave

"To understand recursion, you must first understand recursion."  - Unknown Zen Master

Top 10 Contributor
Posts 2,340
Michael,

here's some code for another workaround, this time keeping the <expt > structure. The trick is to write the responses from the survey to an <item> element before presenting them in a <trial> element (changes are highlighted).

*** Code Starts Here ***

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

<block stuff>
/ trials = [1=florida_ed2; 2=choices; 3=some]
</block>

<surveypage florida_ed2>
/ caption = "Please answer the following demographic questions (continued)"
/ questions = [1=florida_ed1]
/ ontrialend = [item.florida_ed1_response.item = radiobuttons.florida_ed1.response]
</surveypage>

<trial some>
/ inputdevice = mouse
/ stimulusframes = [1=sometext]
/ validresponse = (sometext)
</trial>

<text sometext>
/ items= ("response = <% item.florida_ed1_response.item.1 %>; trial=<% trial.choices.response %>")
</text>

<item florida_ed1_response>
</item>


<text choiceA>
/ items = ("Pick A")
/ size = (60%, 9%)
/ position = (50%,45%)
/ valign = bottom
/ txcolor = blue
</text>

<text choiceB>
/ items= ("Pick B")
/ size = (60%, 9%)
/ position = (50%, 55%)
/ valign = bottom
/ txcolor = blue
</text>

<trial choices>
/ stimulusframes = [1=choiceA, choiceB]
/ validresponse = (choiceA, choiceB)
/ inputdevice = mouse
</trial>

<radiobuttons florida_ed1>
/ fontstyle = ("Arial", 1.5%)
/ caption = "What was the last college that you attended in Florida?"
/ options = ("Barry University","Beacon College","Bethune-Cookman College","Eckerd College","Embry-Riddle","Flagler College",
"Florida A&M Law School","Florida A&M University","Florida Agriculture & Mechanical University","Florida Atlantic University",
"Florida Coastal School of Law","Florida Gulf Coast University","Florida Institute of Technology","Florida International University",
"Florida International University School of Law","Florida Southern College","Florida State University","New College of Florida",
"Nova Southeastern University","St Thomas University School of Law","Stetson University","University of Central Florida",
"University of Florida","University of Miami","University of North Florida","University of South Florida","University of West Florida")
</radiobuttons>

*** Code Ends Here ***

Hope this helps,
~Dave

"To understand recursion, you must first understand recursion."  - Unknown Zen Master

Top 10 Contributor
Posts 1,054

Thanks for reporting this bug. I am working on the fix and plan to release an update as soon as possible.

-Sean

Top 150 Contributor
Posts 9
Dave, thanks for the work around.  It's gotten me over that stumbling block.

Sean, great.  I'm sure future users will appreciate it.

 - Mike
Top 10 Contributor
Posts 2,340
Michael: I'm glad that one of the workarounds posted did the trick for you.

Sean: I don't mean to bother you (knowing that you're a busy person), but could I get your thoughts on this matter:

Dave:
I think it would be great to have separate properties for accessing response 'options' and 'optionvalues'. Specifying numerical '/ optionvalues' is great for data recording and analysis, but if you want to give participants feedback on some of their choices, a numerical value sometimes isn't what you want. To clarify:

<radiobuttons q1>
/ caption="Who was the first president of the United States:"
/ options=("George Washington", "Abraham Lincoln", "Thomas Jefferson")
</radiobuttons>

In this case <% radiobuttons.q1.response %> will give you "George Washington" (at least if the participant is reasonably smart...). But when setting

<radiobuttons q1>
/ caption="Who was the first president of the United States:"
/ options=("George Washington", "Abraham Lincoln", "Thomas Jefferson")
/ optionvalues=("1", "2", "3")
</radiobuttons>

<% radiobuttons.q1.response %>  will give you "1" with no (easy) way to retrieve the original response text "George Washington". I'd basically like to have both options at all times via different properties such as <% radiobuttons.q1.response %> for the response text and <% radiobuttons.q1.responsevalue %> for the associated numerical value.



Cheers,
~Dave

"To understand recursion, you must first understand recursion."  - Unknown Zen Master

Top 10 Contributor
Posts 1,054

Hi Dave,

Great suggestion, I think the value is obvious. Currently, there are "option" and "optionvalue" properties that allow you to access each option by index. You could write an expression that compares the response to each of the values and returns the matching one. Needless to say, that's a bit cumbersome.

I could see two new properties - "responsetext" and "responsevalue" - that return the caption and the underlying value assigned to the response respectively. Not difficult to add, I'll try to get this into the next update.

-Sean

Top 10 Contributor
Posts 2,340
seandr:
You could write an expression that compares the response to each of the values and returns the matching one.


Which is basically what I ended up doing. I also ended up thinking "so many lines of code for such a small thing", so I'm glad to hear that this will be much easier in the (near) future.

Many thanks,
~Dave

"To understand recursion, you must first understand recursion."  - Unknown Zen Master

Page 1 of 1 (8 items) | RSS
Powered by Community Server (Non-Commercial Edition), by Telligent Systems