Howdy, Stranger!

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

Supported by

[open] Block Randomisation with Inline Script at the Run Phase

edited July 2013 in OpenSesame

Hi

I am using the following script to randomise across the blocks. This randomises the blocks presentations BUT the number of presentation is more than the number of blocks. Can you please advice have to fixit?
I also like to use the dummy variables in the the blocks to have special randomisation orders.

Thanks in advance,

Masoud

from random import shuffle

# Uncomment for 0.25 and before
# exp = self.experiment

# Create a list of items that are part of the sequence
# These items must be present somewhere in the experiment.
# An easy solution is to add them to a dummy_sequence at
# the start of the trial and set the 'run if' statement of
# the dummy_sequence to 'never'.
item_list =  ['loop1', 'loop2', 'loop3', 'loop4','loop5','loop6']

# Randomize the item order. Of course you can also do more
# complicated things, such as have the order depend on the
# subject nr, etc.
shuffle(item_list)

# First, prepare all items
for item in item_list:
    exp.items[item].prepare()

# Now run them!
for item in item_list:
    exp.items[item].run()

Comments

  • edited 1:08AM

    Hi Masoud,

    You should set the Run if statements of the loops to 'never', like so:

    image

    Otherwise all loops are executed once in the normal way, and once by your inline script.

    Does that make sense?

    Best,

    Lotje

  • edited 1:08AM

    Dear Lotje
    Your kind comment works well. Thanks.

    Peace,
    Masoud

  • edited 1:08AM

    Dear Lojte
    Can I also use the dummy variables in the the blocks to have special randomisation orders?
    Masoud

  • edited 1:08AM

    Hi Masoud,

    Can I also use the dummy variables in the the blocks to have special randomisation orders?

    What kind of 'special randomisation' do you mean? If you provide us with some more information about how exactly you would like to randomise your blocks I'm sure we can figure something out.

    Best wishes,

    Lotje

  • edited September 2013

    Dear Lojte,

    Here it is the design where I have 6 blocks, each one includes two sets of word stimuli with a relation between them (e.g., Shorter Than [ST] or Taller Than [TT]) to be learned and then to be tested by participants.
    Therefore, There will be ten possible pairs in each block, presented in a random sequence, and then a different random sequence of those same ten pairs again, such we have 20 relation shown.

    AB
    AC
    AD
    AE
    BC
    BD
    BE
    CD
    CE
    DE, 
    

    The point is that the same pair should not be presented successively twice (as this could happen at the point of transition between the first and the second random sequence).
    So one way to deal with that is :
    Within each random series of 10 pairs, to create a second random sequence of 0,1 to determine the left-right orientation of the display. So, for the first random series of 10 pairs we might have created the orientation sequence [0010111001] which means that, combined with the first random sequence (which determines the order of pairs), we would now have the following presentation schedule for the first 10 pairs, for example:

    AB, dominant element left (0), => A     B
    BE, dominant element left (0), => B      E
    CD, dominant element right (1), => D     C
    AE, dominant element left (0), => A     E
    AC, dominant element right (1), => C     A
    DE, dominant element right (1),     => E     D
    BD, dominant element right (1),     => D     B
    BC, dominant element left (0), => B     C
    AD, dominant element left (0), => A     D
    BE, dominant element right (1),     => E     B
    

    For the second series of 10 pairs (in a new random sequence), we just reverse the orientation for each pair, vis-a-vis the first series. So we get, for example:

    AD, dominant element right (1), => D     A
    BC, dominant element right (1),     => C     B
    CD, dominant element left (0), => C     D
    AB, dominant element right (1),     => B     A
    BD, dominant element left (0), => B     D
    BE, dominant element left (0), => B     E
    AE, dominant element right (1),     => E     A
    AC, dominant element left (0), => A     C
    BE, dominant element right (1),     => E      B
    DE, dominant element left (0), => D     E
    

    The program is ready now except for this randomization order, which I hope I could handle it.
    Any advice is appreciated.

    P.S: I have asked the same question from Sebastiaaan at the follwing address but it seems to me somehow difficult to understand.
    http://www.cogsci.nl/forum/index.php?p=/discussion/565/open-conditioned-randomisation-across-the-trial-sequence#Item_2

    Thanks,
    Masoud

  • edited September 2013

    ..and here it is the trial sequences as formatted text:

    image

    Masoud

  • Hi Massoud,

    To make pseudo-random trial lists, I would advise you to download a program called Mix. This allows you to put constraints like the ones you describe above, to your trial list. After making pseudorandom trial lists, you can simply copy-and-paste those in your loop items, and set the duration to 'sequential', instead of 'random'.

    Mix can be downloaded here:

    And the reference is:

        Van Casteren, M., & Davis, M. H. (2006). Mix, a program for pseudorandomization. Behavior research methods, 38(4), 584–589.

    I hope this helps.

    Best wishes,

  • edited September 2013

    Dear Lojte

    Thanks, but I guess then the same random order will be shown to all the participants. Indeed I am looking for a solution to present a unique random order to each of the participants.

    Masoud

  • Hi Masoud,

    I see what you mean. Unfortunately, I don't know of any method to do this in a fully-automatised manner.

    If I want to pseudo-randomise trial lists, I use Mix to generate new trial lists for every participant, and change the block loop accordingly. If you don't mind doing this manually, perhaps you could consider a similar method.

    Good luck!

    Best,

    Lotje

Sign In or Register to comment.