Howdy, Stranger!

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

Supported by

[open] Follow-up on how to increase widget size for questionnaires

JSSJSS
edited December 2014 in OpenSesame

Hi,

I would like to follow up on the previous thread regarding widget size. I am setting up some questionnaires, but the boxes and font sizes need to be much larger. I replaced the checkbox images, but for the rating scale, I still need to modify the font size and background bar. Is there an easy way to add these values to my opensesame script? Are there any more example scripts for different types of questionnaire available?

Thanks for help and suggestions!

Comments

  • edited 3:46AM

    Hi Jasmin,

    So I'm guessing you figured out how to replace the checkbox images from this discussion. And now you would like to change the font size and the size of the rectangle around the checkboxes as well. Is that right?

    Changing the font is really easy. You can just do that in the general tab of your experiment.

    Changing the rectangle around the checkboxes isn't as easy, because it is hard-coded into the theme engine. However, what you could do is hack into the internals of the theme engine, and replace the function that specifies the box size. This is not possible in OpenSesame script, so you'd need to use Python script.

    Like this:

    from libopensesame import widgets
    
    my_custom_box_size = 64
    
    # Create a form and replace the box_size() function of the theme
    # engine by a lambda function that returns a custom value
    form = widgets.form(exp)
    form.theme_engine.box_size = lambda: my_custom_box_size
    # Add a rating scale and button to the forum
    scale = widgets.rating_scale(form, nodes=3)
    button = widgets.button(form, text='Ok')
    form.set_widget(scale, (0,0), colspan=2)
    form.set_widget(button, (0,1), colspan=2)
    # Execute it!
    button_clicked = form._exec()
    

    This is really a hack! But for now it's the only solution.

    Cheers,
    Sebastiaan

  • JSSJSS
    edited 3:46AM

    Hi,

    Thanks for your reply, but I am still fiddling around with the questionnaire design...Since I want to use it on the Tablet, do you know where I have to replace the checkbox images on the Tablet?

    Thanks!

  • edited 3:46AM

    Hi Jasmin,

    Another tricky question. On Android (as you probably found out), you cannot easily replace the images, because they are part of the package. What you can do instead is another hack: You can redirect OpenSesame to a custom file in the file pool. Let's assume that you have two files in the file pool, called my-unchecked-box.png and my-checked-box.png. You can then add the following script to the prepare phase of an inline_script at the start of the experiment.

    import os
    # Use custom resource for unchecked box
    resource_path = os.path.join('widgets', 'gray', 'box-unchecked.png')
    custom_path = exp.get_file('my-unchecked-box.png')
    exp.resources[resource_path] = custom_path
    # Use custom resource for checked box
    resource_path = os.path.join('widgets', 'gray', 'box-unchecked.png')
    custom_path = exp.get_file('my-checked-box.png')
    exp.resources[resource_path] = custom_path
    

    Basically, what this does is redirect all lookups of widgets/gray/box-unchecked.png and widgets/gray/box-checked.png to your custom images in the file pool.

    Does that clear things up?

    Cheers,
    Sebastiaan

  • JSSJSS
    edited February 2015

    Great, thanks for the workaround! :)

    I have two remaining questions regarding forms:

    • Is there a way to get back to a previous screen (optimally to check the given response)?
    • How can I make sure that a response is provided for each question before moving on to the next screen with the next botton?

    Thanks for your help!

  • edited 3:46AM

    Hi Jasmin,

    If you want to control the flow of the experiment in more detail, for example allowing 'back' responses or repeating items until some criterion is met, you need to that programmatically. Lotje provided a pretty elaborate explanation of this here:

    Cheers,
    Sebastiaan

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games