Howdy, Stranger!

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

Supported by

Restarting a Loop

edited February 2017 in OpenSesame

I have an OpenSesame loop which cycles through a sequence consisting of a sketchpad, keyboard, and logger. I would like the loop to restart from the first cycle after a user makes an incorrect response. Could you tell me how I reset the loop? Thank you!

Comments

  • Hi Christopher,

    It is a little tricky to give you an out-of-the-box solution for that problem without actually trying to implement this. In general, I advice you to have two nested loop-sequence constructs. The outer loop is set to a high repeat number with a certain break_if statement, so that it will just keep on running, unless the user breaks out of it. Inside this loop you put the actual trial_loop which is what you keep on iterating until participants finish or make a mistake. Also in this loop you should define a break_if statement, e.g. if correct_response == False: break, or something along these lines. Importantly, you also need to define a variable in the very end of this loop that indicates whether this loop was finished without a mistake or not. This variable you can then use for the outer loop, to decide whether you will break it and continue with the rest of your experiment, or repeat the inner loop again.

    It surely is a little hard to grasp, but do you think you have an idea of what I tried to bring across?

    Eduard

    Buy Me A Coffee

  • Hi Cristopher,

    I think the attached example should help you get started. I added an inline_script item at the end of the trial_sequence

    and placed the following code in the Run_phase tab:

    # If the participant gave an incorrect response:
    if var.correct == 0:
    
        # Re-execute the whole block_loop item
        items.execute(u'block_loop')
    

    Not sure how you want to log and analyze the output, though. Are you going to analyze only the trials that were all correct in a row?

    Cheers,

    Lotje

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

  • Hi,
    I tried using the
    items.execute(u'sequence_name').
    It runs the sequence again but, it runs the next row in the loop.
    I want to run the same row again.

    Details: subjects read a text, than needs to answer questions. If he wants he can press 5 and go back to the text and back again to the same question.

    any suggestions?

    Thanks,
    Nachshon Korem

  • Hi,

    So you don't want to repeat a sequence but only a previous item in that sequence. Is that correct? Can you try to replace u'sequence_name with the item's that you want to run?

    Eduard

    Buy Me A Coffee

  • Hi,
    1st thanks for your replay. Yes I tried that, it still continue to the next iteration.
    I found an awful way to do it, add another loop and break it if subject responds.
    Any better ideas?

  • Hi Korem,

    I refuse to think of better ideas if you have a solution that works just fine and doesn't have any other drawbacks than being "ugly" (beauty is in the eyes of the beholder...)

    Eduard

    Buy Me A Coffee

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