Howdy, Stranger!

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

Supported by

[open] Repeat trial until correct - how to log previous incorrect respones?

edited February 2015 in OpenSesame

Hello! I'm still a novice with OpenSesame (such a great program!!) so apologies if my simple question has a simple answer.

I need participants to be able to repeat a trial until they submit a correct response. I've managed to figure out how to repeat the trial on the following discussion thread:

http://www.cogsci.nl/forum/index.php?p=/discussion/535/solved-how-to-repeat-a-particular-trial-until-correct-before-moving-on-to-next-trial/p1

However, when I open my data file, it only logs the very last trial (i.e. the final correct response). So if my experiment runs 36 trials, but a participant made 10 errors, I'm only seeing 36 rows of data instead of 46. Is there a way I can log both the incorrect and correct responses each trial?

I tried to search for examples on the discussion forum but couldn't seem to find an ideal fit? But I'm hoping there is a relatively simple solution that I can implement?

Thank you!!

Comments

  • edited 10:49PM

    Hi,

    It sounds like the logger, which is used to save the data to file, is not part of the sequence that is repeated on an incorrect response. So you would need to move the logger so that it is repeated as well.

    That's quite a generic answer, but without knowing any details I can't say much more about it. If you don't manage to figure it out, could provide some info about the structure of the experiment + a screenshot of the overview area?

    Cheers!
    Sebastiaan

  • edited 10:49PM

    Hi Sebastian

    Thank you very much for your prompt reply – and apologies that I haven’t replied sooner. I’m currently overseas and internet access isn’t as reliable as I had hoped for.

    Thank you for your advice. I’ve had a go at your suggestion which works (thank you!), but it has thrown up another issue (in terms of the way I want to log the data) which I'm hoping you can help with?

    Essentially each trial presents several objects (which is an image on sketchpad) on a 5x5 grid (so I’m using the ‘touch response’). On each trial the participants are required to (a) select and (b) move one of the objects on the grid. The correct object-selection and object-move responses depend on the trial type. There are 4 types – with each trial type determining a certain type of selection and move (so I’ve set up 4 trial type sequences). Because I need to present each trial type in non-equal proportions (i.e. 40% of trials = trial type1, 40%=trial type 2, 20%=trial type 3, 20%=trial type 4), I’m using an inline script to create a list of all trial types (and set it to randomly shuffle).

    For each trial type sequence, if a participant makes the wrong object selection (i.e. has touched on the incorrect grid), the sequence repeats itself – so participants get another chance (or more if needed) to select the correct object. After selecting the correct object, the sequence continues and the participant then needs to move the object by touching the grid area they want to move the object to. If the participant makes the wrong move, the trial repeats itself (from the very beginning) so participants gets another chance to select the correct object AND move it to its correct location. FYI - the objects do not actually move on the screen; the participant merely touches the grid twice to represent (a) the object they want to select and (b) the location where they want to move the object to.

    I’ve managed to add separate loggers (one for ‘select’ and one for ‘move’) inside the sequence as suggested. I’m not sure if this was the best way to do it, as I need to be able to collect data for all object-selections and object-moves, whether the participant makes an incorrect or correct response. At present, the way I’ve set it up seems to work in gathering all of the ‘select’ and ‘move’ responses (both correct and incorrect). So each time data is logged (via the logger file) it creates a new row of data – resulting in potentially several rows for one trial. My question is whether there’s a more simple/elegant way to record responses and/or set up my experiment so that one row of data represents one trial – which includes (and counts) all correct and incorrect selection and moves. For example, if a participant made 2 selection-mistakes before selecting the correct object and 3 move-mistakes before moving the object to the correct location (so the sequence would have repeated seven times), can the data for that single trial be placed within a single row of data with columns that would ultimately show the number of incorrect selections (eg. this column would show ‘2’ to represent 2 incorrect selections), correct selections (1), incorrect moves (3) and correct moves (1)?

    Do you have any suggestions? I’ve attached a screen shot so you can see how I’ve set up the experiment (including an overview of a single trial type sequence, ‘c_him’) so you can see how I’ve set up things up.

    Thank you in advance for any help and suggestions!

    Marie

    image

  • edited 10:49PM

    Hi Marie,

    If I understand correctly (but I'm not sure), the end of the c_him sequence is only reached when the participant has successfully completed the trial, so when you want to log everything. Couldn't you simply use a single logger and put it at the very end of the c_him sequence? Or is there a reason why this wouldn't work in your case?

    Cheers!
    Sebastiaan

  • edited 10:49PM

    Hi Sebastian - sorry I did reply over a month ago to your last comment - but it appears it never got through? Anyhow, I did manage to figure it out in the end. I used a single logger as you suggested, but then used separate inline scripts to set different response variables so I could effectively 'track' what was happening throughout each trial. Thank you.

    I do have another question. I want to use a slider with in-line script. Currently I'm using the slider plug in on my Windows laptop - which works perfectly, BUT the slider plug-in isn't working with Mac's? I have two students with Macs that will be running my program so I'm trying to find a way around this. I did come across the following post on using an inline script (http://forum.cogsci.nl/index.php?p=/discussion/40/solved-implementing-a-slider/p1) however, I want the slider to appear when I'm showing a sketchpad item. At present, the sketchpad item disappears before I can answer with the slider scale. At present, using the inline script, my sketchpad is calling up images from my file pool, according to the variables set up in a loop table - and I need the image to remain on the screen at the same time as the participant is responding with the slider. So essentially I need exactly what I'm getting with the slider-plug in on my Windows laptop - but using inline script instead?

    Sorry if this is something that should be easy to figure out but I'm still having trouble.
    Many thanks for your assistance.

    Marie

  • edited 10:49PM

    Hi Marie,

    So if I understand correctly you want to adapt that script so that the slider is drawn on top of an existing sketchpad. Is that right?

    To do this, you would need to change this line:

    my_canvas.clear()
    

    to

    my_canvas = self.copy_sketchpad('my_sketchpad')
    

    where 'my_sketchpad' is the name of the sketchpad that you want to copy. Does that make sense? So you don't start with a clean canvas, but start with a copy of 'my_sketchpad'. If you want to avoid the sketchpad from being shown on its own (i.e. only as part of the slider), you can set its run-if statement to 'never'.

    As an aside, the Mac version of OpenSesame is known to be buggy, although @dschreij is currently working on a better version.

    Cheers!
    Sebastiaan

    So the full script would be something like:

    from openexp.canvas import canvas
    from openexp.mouse import mouse
    
    my_mouse = mouse(exp, timeout=20)
    
    # Set slider dimensions
    slider_w = 500
    slider_h = 10
    slider_x = self.get("width")/2-slider_w/2
    slider_y = self.get("height")/2-slider_h/2
    
    while True:
    
        # Determine the slider fill based on the mouse position
        pos, time = my_mouse.get_pos()
        x, y = pos
        slider_fill = min(slider_w, max(0, x-slider_x))
    
        my_canvas = self.copy_sketchpad('my_sketchpad')
        # Draw some text (this can be anything)
        my_canvas.text("Question goes here", y=slider_y-100) 
        my_canvas.text("Click to accept ...", y=slider_y+100) 
        # Draw the slider frame
        my_canvas.rect(slider_x, slider_y, slider_w, slider_h)
        # Draw the slider fill
        my_canvas.rect(slider_x, slider_y, slider_fill, slider_h, fill=True)                
        # Draw the mouse cursor
        my_canvas.arrow(x+5, y+10, x, y)
        my_canvas.show()
    
        # Poll the mouse for buttonclicks
        button, position, timestamp = my_mouse.get_click(timeout=20)
        if button != None:
            break
    
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