Howdy, Stranger!

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

Supported by

[open] Randomizing blocks and trials

edited March 2016 in OpenSesame

Hi to all,

I have three trials, in each there are three blocks. Is there a way to automatically run the trials in a random order and run the blocks within each trial in a random order? I need this to be done for each participant,

I saw the counter-balancing movie but it did not give me a good solution.

Thanks in advanced
Amihai

Comments

  • edited March 2016

    Hi Amihai,

    Of course. Usually, your sequences would only have to contain one block or one trial, and you would run these sequences three times by means of a loop item. In the loop item you could then define three conditions (leading to three trial- or block types), and the three conditions are then run randomly by default.

    If you want to stick to your three trials/blocks instead, you'll still have to place each sequence in a loop that runs three times. At the beginning of the experiment you also have to insert an inline script where you create variables such as exp.trial_count = 0. At the end of each cycle through the sequence you update this variable by means of an inline_script that contains exp.trial_count += 1 in the run-phase. Now you just have to decide randomly which trial will be run when. In the inline_script at the beginning of your experiment, you could add the following:

      import random
      trials = [0,1,2]
      random.shuffle(trials)
    

    Lastly, you can click on the sequence that contains your trials, and add run-if statements, such as run-if [trial_count] = trials[0], [trial_count] = trials[1] and [trial_count] = trials[2].

    Cheers,

    Josh

  • edited 1:33PM

    Dear Josh,

    I am not sure i understood everything you wrote but i think i got the main idea and it should solve my problem.
    Thank you very much!

    Amihai

Sign In or Register to comment.