Howdy, Stranger!

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

Supported by

Using multiple choice forms with a picture

Hi,

I am trying to prepare and experiment where I am going to show a picture and ask questions. I need to have in the same page a picture and multiple choice question. I could not find how to do that.

Thanks

Ergun

Comments

  • FabFab
    edited October 3

    Hi @Ergun,

    There would be multiple ways of achieving this. IU'm assuming you're looking for a solution in open Sesame and not OSWeb (since you posted this message in this forum).

    Here are a coupe of ways to do it:

    Method 1

    Usiing an inine_script object (Python) to draw a new canvas, display the picture and the question, then show the canvas. You then use the keyboard object to take a response.

    The Canvas can be drawn like using code like this in its "PREPARE" phase:

    # START_PREPARE_PHASE
    my_canvas = Canvas() # Create a Canvas object
    my_canvas['image'] = Image(pool['d23.png'], x=0, y=-150) # Add image to canvas. Adjust x, y for positioning
    my_canvas.text('What name would you give this creature?', x=0, y=100) # Add question to the canvas
    my_canvas.text('1. Zorglub', x=0, y=150) # Add options to the canvas
    my_canvas.text('2. Bixby', x=0, y=180)
    my_canvas.text('3. Leno', x=0, y=210)
    # END_PREPARE_PHASE:
    

    and like this in its "RUN" phase:

    # START_RUN_PHASE
    my_canvas.show() # Show the Canvas with the image and text
    # END_RUN_PHASE
    

    You can limit the accepted key strokes for the keyboard object to avoid that a response is taken if the participant presses anything else than the 1, 2 or 3 keys (in my example).


    Method 2

    Method 2 uses the form_base object (see documentation: https://osdoc.cogsci.nl/4.0/manual/forms/custom/).


    It consists in displaying the form that you designed in the way you want information to be displayed. For example:

    # Display the image (occupying a larger row)
    # Display the question
    # Add the multiple-choice buttons
    set timeout infinite
    set spacing 10
    set rows "2;1;1;1;1"
    set only_render no
    set margins "50;50;50;50"
    set description Example
    set cols 1
    set _theme gray
    widget 0 0 1 1 image path="d93.png"
    widget 0 1 1 1 label text="What do you think this creature's hobby is?"
    widget 0 2 1 1 button text=Painting var=button_painting
    widget 0 3 1 1 button text=Jogging var=button_jogging
    widget 0 4 1 1 button text=Yoga var=button_yoga
    

    In this example, I'm using buttons for the possible response options, and since Open Sesame only registers whether a button is pressed as a "yes" or "no", we then need an inline_script object (Python) to process the response and strore it in a variable (in this example, in the "response" variable).

    if button_painting == 'yes':
    response = 'Painting'
    elif button_jogging == 'yes':
    response = 'Jogging'
    elif button_yoga == 'yes':
    response = 'Yoga'
    else:
    selected_hobby = 'No selection'
    


    Note that for both methods, you must make sure that the images are stored in the pool.

    Also note that I here set the questions, image and response options litterally. If you were to run many trials, you'd want to store this information in variables of the loop and then modify the methods above to inject the variable names where appropriate using the { }.

    I attach a working example of both methods.


    Note that other methods are possible (e.g., you could program the whole thing directly in Python if you wished to). If you were planning to run your experiment in a browser, you'd have to rely on javascript-based solutions.

    Best,

    Fabrice.

    Buy Me A Coffee

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