Howdy, Stranger!

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

Supported by

[solved] Eliminating a sequence

edited March 2013 in OpenSesame

Hi Sebastiaan,

Thank you for your Opensesame software! Is there a way to eliminate the highlighted "trial_sequence" category so that my smaller sequences (4 of them are shown below) are under the "Bigloop"? My goal is to randomize the smaller sequence chunks, but they are currently going in order.

image

Thank you!

Comments

  • edited March 2013

    Hi,

    Welcome to the forum!

    Is there a way to eliminate the highlighted "trial_sequence" category so that my smaller sequences (4 of them are shown below) are under the "Bigloop"?

    No, a loop item can only be wrapped around one sequence item. And a sequence item can only run it's content in sequence.

    What you could do to run your four small sequence items in random rather than sequential order is the following:

    • Open your trial_sequence item and set the "Run if" statements of the four small sequences to 'never'.
    • Append an inline_script item to your trial_sequence item (make sure to place it at the beginning).
    • Put the following piece of Python inline code to the Prepare phase tab of the inline_script item (see comments for further explanation):
    import random
    
    # Make a list containing the four names of the small sequence items:
    l = ['s1', 's2', 's3', 's4']
    
    # Randomise the list by using the random.shuffle() function:
    random.shuffle(l)
    
    # Walk through the (randomised) list:
    for sequence in l:
    
        # Prepare the sequence item:
        exp.items[sequence].prepare()
    
        # Run the sequence item:
        exp.items[sequence].run()
    

    An example experiment can be downloaded here (save with the extension .opensesame)

    I hope this helps!

    Best,

    Lotje

    Buy Me A Coffee

  • edited 11:28PM

    Dear Lotje,

    Thank you so much for your help! I am not quite there yet...did I misspell some things? My small sequences are called "small1...small8" so I renamed them:

    image

    image

  • edited 11:28PM

    You wrote for sequence in 1, while the correct code is for sequence in l, where l is the name of the list containing the sequence names (in your case 'small1', 'small2' etc.).

    Cheers,

    Andrea

  • edited 11:28PM

    Andrea,

    Thank you for your help! I tried to replace the 1 with the 'small1', 'small2,' etc. but I am not sure why it still doesn't work? I also tried typing in exp.items['small1', 'small2,' etc].prepare() but it didn't work either. Sorry for taking a while to figure this out...

    image

  • edited 11:28PM

    Hi,

    What Andrea meant is that you accidentally changed the 'l' in the for statement to '1'. And in your most recent post, you named the list '1' instead of 'l'.

    The code should be as follows. For the sake of clarity, I renamed the list to 'sequence_list' instead of 'l':

    # Make a list containing the four names of the small sequence items:
    sequence_list = ['s1', 's2', 's3', 's4']
    
    # Randomise the list by using the random.shuffle() function:
    random.shuffle(sequence_list)
    
    # Walk through the (randomised) list:
    for sequence in sequence_list:
    
        # Prepare the sequence item:
        exp.items[sequence].prepare()
    
        # Run the sequence item:
        exp.items[sequence].run()
    

    I also uploaded an example experiment (see the link in my first post) at which you could take a look if you want.

    Does this answer your question?

    Best,

    Lotje

    Buy Me A Coffee

  • edited March 2013

    For simplicity, try to copy and paste the code originally posted by Lotje, and you will see that it will work. Perhaps, you are confounding 1 (number) with l (letter). Basically, l is the name of the list containing the various sequences (l = ['small1', 'small2', 'small3', 'small4', 'small5', 'small6', 'small7', 'small8']). Then, you shuffle this list (random.shuffle(l)) and run each list element, that is each sequence (for sequence in l).

    In any way, if you copy and paste the Lotje's code, it will works.

    Hope this helps.

    Edit: Lotje and I posted at the same time. Lotje's answer should clarify your doubts

  • edited 11:28PM

    Thank you so much, Lotje and Andrea! It finally works =)

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