Using multiple choice forms with a picture
in OpenSesame
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
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:
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:
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).
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.