Display image as radiobutton response option


Author
Message
fflade
fflade
Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)
Group: Forum Members
Posts: 11, Visits: 117
Hi,

I find myself bothered by a rather humble problem: I want to have pictures instead of text as response options in a radiobutton question. I managed to display image elements on the surveypage, but they do not match to the radiobuttons and are not connected to them in any way, which is neither elegant nor practical. Thank you very much for your help!

Best,
Felicitas




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: 12K, Visits: 98K
It is not possible to define images as response options in <radiobuttons>. Depending on your needs, you can either use standard <trial> elements with <picture>s defined as responses (see e.g. http://www.millisecond.com/download/library/v2/CustomLikert/customlikert.zip ) or build something along the lines of https://www.millisecond.com/download/library/v3/selectitems/selectitems.zip

Edited 8 Years Ago by Dave
fflade
fflade
Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)Esteemed Member (2.5K reputation)
Group: Forum Members
Posts: 11, Visits: 117
I chose the second option as it fits better with my existing script, and it works just fine :)
But how do I restrict the anwers to a single checkbox (single choice)? If necessary, something like "Enable continue button only if a single box is checked on this page" would work, too. Thank you so much!

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: 12K, Visits: 98K
There are two expressions in the script (see the <expressions> element), which count the number of checked options:

<expressions>
/ kittencount = checkboxes.kitten1.checked.1 + checkboxes.kitten2.checked.1 + checkboxes.kitten3.checked.1 + checkboxes.kitten4.checked.1 + checkboxes.kitten5.checked.1 + checkboxes.kitten6.checked.1 + checkboxes.kitten7.checked.1 + checkboxes.kitten8.checked.1 + checkboxes.kitten9.checked.1
/ puppycount = checkboxes.puppy1.checked.1 + checkboxes.puppy2.checked.1 + checkboxes.puppy3.checked.1 + checkboxes.puppy4.checked.1 + checkboxes.puppy5.checked.1 + checkboxes.puppy6.checked.1 + checkboxes.puppy7.checked.1 + checkboxes.puppy8.checked.1 + checkboxes.puppy9.checked.1
</expressions>

The page is repeated per the /branch if the count is not as specified (4 options selected in the original):

<surveypage kittenpage>
/ caption = "Choose the 4 cutest kittens from the set below."
/ questions = [1=kitten1; 2=kitten2; 3=kitten3; 4=kitten4; 5=kitten5; 6=kitten6; 7=kitten7; 8=kitten8; 9=kitten9]
/ stimulusframes = [1=kitten1, kitten2, kitten3, kitten4, kitten5, kitten6, kitten7, kitten8, kitten9]
/ branch = [if (expressions.kittencount != 4) surveypage.kittenpage; ]
</surveypage>

You need to do the same thing. Count the options checked in an expression, repeat the page via /branch if the count is not equal to what you want (1 in your case):

<surveypage kittenpage>
/ caption = "Choose the 4 cutest kittens from the set below."
/ questions = [1=kitten1; 2=kitten2; 3=kitten3; 4=kitten4; 5=kitten5; 6=kitten6; 7=kitten7; 8=kitten8; 9=kitten9]
/ stimulusframes = [1=kitten1, kitten2, kitten3, kitten4, kitten5, kitten6, kitten7, kitten8, kitten9]
/ branch = [if (expressions.kittencount != 1) surveypage.kittenpage; ]
</surveypage>



GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search