Radiobuttons option text wrap problem and solution


Author
Message
AKrishna
AKrishna
Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)Distinguished Member (3.8K reputation)
Group: Forum Members
Posts: 118, Visits: 396
Hi all,

I just found a problem in my script which was causing issues with radiobutton options wrapping around unnecessarily and being difficult to read. The following code produces an example of what I mean:


<radiobuttons BIF_step01>
/ caption = "Avocado zerdrücken und mit Zitronen-/Limettensaft mischen."
/ options = ("Guacamole zum Snacken vorbereiten.","Mit einer Gabel wiederholt auf die Avocadostücke drücken.")
/ order = sequence
/ responsefontstyle = ("Arial", 2.3%)
/ position = (10,10)
</radiobuttons>

<radiobuttons BIF_step02>
/ caption = "Gurkenstücke/-raspeln mit Knoblauch und Joghurt mischen."
/ options = ("Tzatziki-Soße für den Beilagensalat machen.","Gurken mit einer Gabel unter Joghurt rühren.")
/ order = sequence
/ responsefontstyle = ("Arial", 2.3%)
/ position = (10,30)
</radiobuttons>

<radiobuttons BIF_step03>
/ caption = "Gemüsestücke mit Brühe einkochen."
/ options = ("Für ein vegetarisches Hauptgericht sorgen.","Süßkartoffeln, Schalotten und Bohnen in einen Topf mit Brühe geben und zum Kochen bringen.")
/ order = sequence
/ responsefontstyle = ("Arial", 2.3%)
/ position = (10,50)
</radiobuttons>

<radiobuttons BIF_step04>
/ caption = "Obazdamischung mit Zwiebeln und Paprikapulver verfeinern."
/ options = ("Den Obazda servierfertig machen.","Zwiebeln unter Butter-Camembert-Masse mischen und dann mit Paprikapulver bestreuen.")
/ order = sequence
/ responsefontstyle = ("Arial", 2.3%)
/ position = (10,70)
</radiobuttons>


<surveypage BIF01>
/ questions = [1=BIF_step01; 2=BIF_step02; 3=BIF_step03; 4=BIF_step04]
/ finishlabel = "Weiter"
/ nextbuttonposition = (48, 90)
/ showbackbutton = false
/ showpagenumbers = false
/ showmousecursor = true
/ fontstyle = ("Arial", 2%)
</surveypage>


It ends up looking like this:


I tried several possible solutions, some suggested by older queries in the forum, including:
- inserting tabs (~t) in the text to make the shorter options as long as the longer ones
- inserting spaces to roughly even out the lengths of the options
- adding line breaks (~n) to force more spacing
- experimenting with "/itemspacing" in the surveypage element
- changing the order from random (as it was originally) to sequence (as it is in the example code) and randomizing manually using /onblockbegin to set option values

Nothing worked. Interestingly, the line breaks and tabs did nothing at all to the displayed text, but the spaces did, sometimes forcing shorter options to break in the same way longer options were already doing.

While tinkering, though, I stumbled upon a solution: when I changed the responsefontstyle's size from 2.3% to 2%, it all worked! Line breaks suddenly started showing up, randomizing option order worked and so on. I thought this was probably a bug worth reporting.

I played around with the sizes a little. On my system (1680 x 1050 resolution), the wraparound problem occurs in the following ranges of responsefontstyle sizes (using Arial as a font):
[1.2381% - 1.3333%]
[2.2381% - 2.3333%]
[3.2381% - 3.3333%]
and presumably so on (didn't test further).

So if you are having the same problem as me, try checking whether it occurs for other responsefontsizes in steps of about .1% - it may help!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View

Reading This Topic

Explore
Messages
Mentions
Search