Howdy, Stranger!

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

Supported by

Using "Skip" in a loop

Hi Forum,

We have a nested loop that we're going "in" and "out" of and are trying to have the nested loop to run in a sequence. Currently, it's repeatedly running the first item in the list over and over. So far we've tried to use the "skip" function and insert a "counter" to skip a given number of trials (n + 1 when n = number of trials completed). This led to the error: The value of skip is too high in loop item "deviant_trial_block1":: You cannot skip more cycles than there are.

Any help resolving this issue would be greatly appreciated.

Comments

  • Hi,

    It is hard to tell what exactly went wrong without knowing the structure of your experiment. Would you mind uploading it? Or at least give a lot more information on your design/structure?

    Thanks,

    Eduard

    Buy Me A Coffee

  • Hi Eduard,

    Thanks for the response. I'll try to be more clear on what the problem is. Our experimental setup is as follows:

    • Participants are to switch back and forth between viewing two different stimuli types (numbers and letters). This is our 1st Loop
    • In one stimuli type, participants are to repeatedly view the same stimulus (i.e., the number 6). This is our first nested loop
    • In the other stimulus type (letters), participants are to view one novel stimulus out of a predetermined list. This is our second nested loop
    • What we're hoping for is that the second nested list will be presented sequentially. This is where we're having problems.
    • Currently, the program presents the first item in the list every time our first loop runs the second nested loop (i.e., the letter A is always presented).

    This is what we want the experiment to look like:

    • 6,6,6,6, A, 6,6,6, B, 6, 6, 6, 6, C, 6,6,6,6,6,6,6, D ....etc. (the number 6 needs to randomly appear 5 to 9 times and the letters need to be sequentially presented between each number string)

    We think the problem is that the nested list doesn't keep track (has no memory) for where the letter is in the sequence (if we put a flag down it repeatedly presents A, but if we have no flag and set are number of cycles to .02 times [so that the participants only see one item], the letters are randomly selected)

    Any help is greatly appreciated!! We're stuck

  • Alright, I can see now.

    I'm not sure how to fix this, while keeping your structure as is (i.e. skipping cycles is a tricky business, which I try to avoid as far as possible).

    However, I think your goal can be rather easy accomplished, if you move most of your scripts into inline_scripts. Such an inline_script (or rather inline_scripts) would replace pretty much everything that is in your curreny loops (both of the nested ones). Below, there is a small example of how this could work. It is just a small demo, of course you would have to adjust it to make it do exactly what you want to.

    The first inline_script can be seen as a preparation in which you have to set the sequence in which you want to present stimuli. It needs to be placed outside the trial_loop.

    import random
    # your letter list
    letter_list = ["A","B","C","D","E"] 
    
    # pick a random digit which to present on the screen
    number = random.choice(range(10))
    
    # actual list of stimuli that will be presented later
    trial_list = []
    
    for letter in letter_list:
        # pick a random number of repetitions of this number
        rep = random.choice(range(5,10))
        trial_list += rep*[str(number)]
        trial_list += letter
    
    # visualization
    # print trial_list
    trial_no = 0
    

    Next, within the trial_loop, you pick the current stimulus draw and present it:


    # prepare phase cv = canvas() kb = keyboard() # requires that you have a trial counter stim = trial_list[trial_no] cv.text(stim) trial+= 1 # run phase cv.show() # either sleep for a certain amount of time # clock.sleep(1000) # or wait for keyboard_response key,time = kb.get_key()

    Does this make sense?

    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