Howdy, Stranger!

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

Supported by

[solved] Control of the stimulus feature repetition in consecutive trials

edited January 2014 in OpenSesame

Dear all,

I prepare the Stroop task experiment,where different words appear in four different colors.
I want to eliminate the repetition of the color in consecutive trials.
To achieve this, I tried the following:

  1. Using a build-in "repeat_cycle" plug-in, and its fine. But it seems to have a bug. If it must to repeat the last cycle it won't do it, it just freezes...

  2. I also tried using an in-line script like the one below, but it also doesn't work. It freezes already on the first usage.

exp.items['trialsequence'].prepare()
exp.items['trialsequence'].run()

Do you have any ideas how can I not allow to the color to be repeated from trial to trial?

Thank you and best regards,

Boris.

Comments

  • edited January 2014

    hi

    I don't know why it freezes but you can try this way:

    1. look at the pic for the exp structure
    2. put the two inline script
      http://pastebin.com/mX8b5B6w
    3. decide how many trails in each block be setting the cycle loop

    enjoy
    dror

  • edited 9:29PM

    Di Dror,

    Thank you for the response and an idea!
    Unfortunately, this kind of solution will not work for me. I didn't mentioned it previously, but I have to dis-balance the proportion of colors.
    As I see it now, the implementation of your idea on this particular case will enable repetition of the color in consecutive trials.

    Thanks,
    Boris.

  • edited 9:29PM

    Hi Boris,

    The issue of pseudo-randomization has come up a few times before on this forum. There are some tools available to prepare a pseudo-random list beforehand, or you can use some scripting to accomplish this in OpenSesame.

    For relevant discussions, see:

    Cheers!
    Sebastiaan

  • edited 9:29PM

    Thanks! It was very helpful.

    However, when I am trying to save my 'stimulus', 'color', and 'correct response' list into the external 'csv' file using following piece of code, it doesn't work (it works in Spyder):

    import csv
    
    myfile = open('test.csv', 'wb')
    wr = csv.writer(myfile)
    wr.writerow(['word', 'color', 'cr'])
    for ii in range(len(final_list)):
        wr.writerow(final_list[ii])
    myfile.close()
    

    Any ideas?

    Thanks and best regards,
    Boris.

  • edited 9:29PM

    Hi Boris,

    An actual error message or description of what doesn't work would be helpful! ;)

    Cheers,
    Sebastiaan

  • edited 9:29PM

    Hi Boris,

    Why would you want to log your variables manually, rather than by appending a logger item to the end of your trial sequence?

    image

    About your Python code: you didn't define the variable 'final_list' before using it. Could that be it?

    Best,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited January 2014

    Hi Sebastiaan and Lotje,

    First of all, my experiment is working in OpenSesame without any error message. In this particular experiment I have two inline_scripts: one before the first loop and another in the sequence (both of them in prepare stage). Please see the first one here, and the second one here.
    The problem is that any test_1.csv (as it defined in the first script) file is saving... On the other hand, it works like it should to work with an external Python IDE (Spyder).

    Regarding the question why I am interesting in this, this way I have the ability to do more precise debugging of my experiment. And of course I am using the logger.

  • edited 9:29PM

    Hi Boris,

    Thanks for providing us with your inline scripts, that really helped!

    I think the "test_1.csv" file is saved in your Home folder. Could that be it? To save it in another directory:

    import os
    dst = os.path.join("/home/lotje/OpenSesame/Scripts", "test_1.csv")
    myfile = open(dst, 'wb')
    

    Does that help?

    Cheers,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited 9:29PM

    Thanks a lot Lotje!

    Indeed it is a case :)
    Is it possible to get current folder (the one with the experiment), in order to save there the 'test_1.csv'?

  • edited 9:29PM

    Hi Boris,

    Yes, that's possible! :)

    import os
    currentPath = self.get('experiment_path')
    dstPath = os.path.join(currentPath, "my_output.csv")
    myfile = open(dstPath, 'wb')
    

    Cheers,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited 9:29PM

    Thanks a lot! It works like charm :)

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