Howdy, Stranger!

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

Supported by

To randomly transfer half of the items from one block_loop to another

I have a sequence of three blocks in my experiment. Block 2 follows Block 1 and contains 18 items (videos). I already have this programmed. Now I want, at the beginning of the experiment, the program to randomly pick half of the 18 items from block 2 and put it into block 1 where the items should also be presented randomized.

Block 1 has 34 items and Block 2 has 18 items. The participant should always be presented 42 Items in Block 1 (34 of original block 1 and 9 from block 2) and 9 in Block 2 (the remaining 9).

I've got the feeling this will only be possible with some Python Inline Script, I hope someone can help.

Best, Katrin


Comments

  • Hi,

    You can use Python to set up the sequences before you enter them, like this (simplified example):

    import random
    # example for 4 videos, but same logic applies for 18 videos
    videos = ['1.flv','2.flv','3.flv','4.flv']
    random.shuffle(videos) # change the order videos
    # select the first half to be present in the first set and the second half for the second one
    first_block = videos[:len(videos)/2]
    second_block = videos[len(videos)/2:]
    # This has split now the 18 videos, add the other 34 items to have the 43 trials
    
    

    Once you have the lists, for each list you can access the items (videos) one by one in the sequence.

    Does that make sense?


    Eduard

Sign In or Register to comment.