Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] ratingscale over 2 rows of a form or aligned vertically

edited June 2013 in OpenSesame

I would like more space for my ratingscale.. Each node has a Dutch name of a healthy snack attached to it and it becomes cluttered..
Can I run the same ratingscale over 2 rows or align it vertically?

Thank you

This is my code now:

import random
from libopensesame import widgets
form = widgets.form(self.experiment, cols=[1,1,1,1,1], rows=[1,1,1,1,1,1,1,1])
exp.gezonde_artikelen = voedsellijst2 = ["aardbei1", "appel7", "banaan1", "bleekselderij1_jpg", "kiwi1", "komkommer1", "yoghurt1", "pear2", "rijstwafel2", "sinaasappel1"]
random.shuffle(voedsellijst2)
plaatjes2 = []
for voedsel in voedsellijst2:
    plaatjes2.append(widgets.image(form,  path=self.experiment.get_file(voedsel + ".png")))

title = widgets.label(form, text='Gezonde Snacks')  
vraag1gezondordenen = widgets.label(form,  text='1. Welke gezonde snacks vind je het MEEST lekker?')
vraag2gezondordenen = widgets.label(form,  text='2. Welke gezonde snack vind je het MINST lekker?')
ratingScale1 = widgets.rating_scale(form, var='gezond_lekkerst',
    nodes=['aardbei', 'appel', 'banaan', 'bleekselderij', 'kiwi', 'komkommer', 'yoghurt', 'peer', 'rijstwafel', 'sinaasappel'])
nextButton = widgets.button(form, text='Verder')
ratingScale2 = widgets.rating_scale(form, var='gezond_minst_lekker',
    nodes=['aardbei', 'appel', 'banaan', 'bleekselderij', 'kiwi', 'komkommer', 'yoghurt', 'peer', 'rijstwafel', 'sinaasappel'])
form.set_widget(title, (0,0), colspan=5)
form.set_widget(plaatjes2[0], (0,1))
form.set_widget(plaatjes2[1], (1,1))
form.set_widget(plaatjes2[2], (2,1))
form.set_widget(plaatjes2[3], (3,1))
form.set_widget(plaatjes2[4], (4,1))
form.set_widget(plaatjes2[5], (0,2))
form.set_widget(plaatjes2[6], (1,2))
form.set_widget(plaatjes2[7], (2,2))
form.set_widget(plaatjes2[8], (3,2))
form.set_widget(plaatjes2[9], (4,2))
form.set_widget(vraag1gezondordenen, (0,3), colspan=5)
form.set_widget(ratingScale1, (0,4), colspan=5)
form.set_widget(vraag2gezondordenen, (0,5), colspan=5)
form.set_widget(ratingScale2, (0,6), colspan=5)
form.set_widget(nextButton, (0,7), colspan=5)
form._exec()

Comments

  • edited 2:22PM

    Hi Natalie,

    Unfortunately it's not possible to adapt the spacing between the rating-scale options according to their word length. So if they don't really fit on one line, I think the best is to use some work-arounds such as:

    1.) Change the margins of the form to have some extra space.

    form = widgets.form(self.experiment, cols=[1,1,1,1,1], rows=[1,1,1,1,1,1,1,1], margins=(10,10,10,10))
    

    2.) Use a smaller font (you can change this under General properties)

    3.) Or present for example all the odd-numbered rating-scale options slightly below the even rating-scale options, such that more of them fit on one row before they start to overlap by using breaks:

    ratingScale1 = widgets.rating_scale(form, var='gezond_lekkerst',
        nodes=['<BR />aardbei', 'appel<BR />', '<BR />banaan', 'bleekselderij<BR />', '<BR />kiwi', 'komkommer<BR />', 'yoghurt', '<BR />peer', 'rijstwafel<BR />', '<BR />sinaasappel'])
    

    I hope this helps!

    Best,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited June 2013

    Hi Natalie,

    as Lotje said I would recommend to change to a smaller font, too.
    http://osdoc.cogsci.nl/usage/text-formatting/

    for example:

    ratingScale1 = widgets.rating_scale(form, var='gezond_lekkerst',
        nodes=['<span size="12">aardbei</span>', '<span size="12">appel</span>'', ...
    

    Also, you could think of using the none labeled rating scale and label your ratings one time at the top with a text label.

    http://osdoc.cogsci.nl/forms/custom-forms/

    Hope i could help a bit,

    Daniel

  • edited 2:22PM

    Thank you both very much. It is solved!
    (In the end it seemed that a bigger monitor already did the trick...pfff.... but your options also work, thank you)

  • edited 2:22PM

    How can I close this discussion BTW?

  • edited June 2013

    To mark a discussion as solved, you can edit the title of the thread and add [solved] (instead of [open]) before the actual title.

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited 2:22PM

    Hi Natalie,

    I presume this is you?

    image

    Congratulations!

    Sebastiaan

  • edited 2:22PM

    very late response (sorry, didn't notice it was here until now), but yes, that's me :-)

Sign In or Register to comment.