Small changes to my experiment
Hi!
I'm currently creating an experiment and although it is mostly finished, I need to add some small changes to make it work even better. However for each of these things I can either find not enough in the documentation or not much at all, so I was wondering if anyone else has come across these things before?
First I will explain my experiment in general to make it more clear. The participants will first see a screen that will introduce them to the experiment. After that they see a fixation dot which they have to press a key to continue on. Then they will see and hear a Dutch idiom (e.g. "Toen kwam hij uit de kast"). After this they can choose if they have heard this idiom before, yes or no, or they can click on the speaker icon to hear the idiom again. After they pressed either the green yes button or the red no button they will see the next screen in which they will have to select who they think could've said the idiom. The speaker icon can be clicked to hear the idiom again if they please and after that they can click one or more of the 4 different pictures on screen. This screen is completed when they press the "next" arrow in the top right corner.
Now as mentioned this mostly works the way I want it to but there are a few things that don't yet:
1) I cannot seem to get the speaker icon to play the current sound file again.
As an example in the prepare part of the "know_screen" I have a line of code which says: text="[Spreekwoord]" , this means that the text displayed takes the current idiom that I'm looping over in the examples loop. However when I try to do the same kind of thing for the sound file, so try using src = exp.pool['[Geluid].ogg'] it tells me that Geluid.ogg does not exist. How should I make it such that it takes the [Geluid].ogg file (so the current sound file of the idiom) in the python code?
2)Creating a frame around a selected picture
It would be nice if a participant knows if they selected a picture. I wanted to do this by adding a frame around the button as soon as the variable of the button is 'yes'. I do this by using the image_button.draw_frame(rect=None, style=u'normal') code that is suggested here: https://www.osdoc.cogsci.nl/2.9.1/forms/imagebutton-functions/ However when I try and run the code, it gives me an error message that image_button does not have a function called draw_frame. How can I draw a frame around the picture? Is there another function?
3)Is it possible to select and deselect a button?
If a person make a mistake in their choice of selected picture I think it would be nice if they could deselect the picture if they would want to do so. However I can't really seem to find any documentation if this is possible or not. Is there a way? And if yes, what would be the most efficient way of doing so? Setting the variables to different values?
I know this is a lot of questions and I understand if there may not be an answer to all of them, but it would really help me get on with my project if even just one of these issues was fixed!
Comments
Hi Sannee,
i have not worked with sound yet.
For your questions 2 and 3:
This piece of code may help you further. Of course, you need to adopt it for your purpose. Especially the x and y positions.
It is a questionnaire with 12 items on one page. You need to select on a scale from 1 to 5 on each scale (scale and item is in the main picture). What i basically did was putting rectangles around the answer scales. You may even change your decisions (all but the last selected item).