Howdy, Stranger!

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

Supported by

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).

    var.Phase='VMIQ'
    
    VMIQ2_start=canvas()
    VMIQ2_start.image(pool['VMIQ2_start.tif'])
    VMIQ2_start.show()
    clock.s leep(1000) #9000 #delete the space (the forum code does not accept it)
    enter.flush()
    VMIQ2_start.text('weiter mit Entertaste' , font_size=18, x=0, y= 300)   
    VMIQ2_start.show()
    key, time=enter.get_key()
    
    VMIQ2_EVI=canvas()
    VMIQ2_EVI.image(pool['VMIQ2_EVI.tif'])
    VMIQ2_IVI=canvas()
    VMIQ2_IVI.image(pool['VMIQ2_IVI.tif'])
    VMIQ2_KIN=canvas()
    VMIQ2_KIN.image(pool['VMIQ2_KIN.tif'])
    
    list_x = [-135,-5,120,240,360]
    list_y = [-173,-132,-90,-49,-7,35,76,118,159,201,243,284]
    
    for modal_i in range(3):
        empty.show()
        lst = []
        list_xy = []
        if modal_i == 0:
            var.modality='EVI'
            pres_image=VMIQ2_EVI
        elif modal_i == 1:
            var.modality='IVI'
            pres_image=VMIQ2_IVI
        elif modal_i == 2:
            var.modality='KIN'
            pres_image=VMIQ2_KIN
    
        for j in range(12):
            for i in range(5):
                pres_image[str(j)+'_'+str(i)] = Rect(x=list_x[i], y=list_y[j], w=90, h=30, color='grey', penwidth=2)
                list_xy.append(pres_image[str(j)+'_'+str(i)])
            lst.append(list_xy)
            list_xy = []
    
        loopi = ['x'] * 12
    
        pres_image.show()
        my_mouse = Mouse(visible=True)
        var.Stim=1 #just to set mouse position
        var.Resp=1 #just to set mouse position
        x=165
        y=-265
        while 'x' in loopi:
            my_mouse.show_cursor(True)
            my_mouse.set_pos((x, y)) #keep it in the last mouse position
            button, (x, y), time = my_mouse.get_click()
            for j in range(12):
                for i in range(5):
                    if (x, y) in lst[j][i]:
                        var.Stim=j+1
                        var.Resp=i+1
                        loopi[j]=True
                        for ii in range(5): #set all others white
                            lst[j][ii].penwidth = 1
                            lst[j][ii].color = 'white'  
                        #mark the selected one
                        lst[j][i].penwidth = 4
                        lst[j][i].color = 'black'
                        print var.Stim, var.Resp
                        log.write_vars()
                        pres_image.show()
    
    my_mouse.show_cursor(show=False) 
    
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