Howdy, Stranger!

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

Supported by

[solved] Random item solution

edited September 2015 in OpenSesame

Hi i am little imbarassed to do this question but probably i miss something that i can’t understand. I have read the tutorial and other topics about random item but I don’t find any solution. In my experiment I have only to "show" 50 "stimulus" that I have created with the sketch pad in the " random order". I created the loop and the sequence in which I have included the 50 items. I have clicked on " random" inside the dialogue loop window but the items come out in sequence and not in random order.

thank to you all !

Comments

  • edited 10:26AM

    Hi,

    The random option in the loop window applies to the variables you indicated there (and thus to the conditions your trials will appear in); not to the items you place in a sequence. The sequence will always run its items in the order you placed them in.

    If you just have 50 stimuli to which no conditions or variables apply, you could create a list of 50 images (e.g. stimulus_list = ['stimulus1.jpq','stimulus2.jpg', etc.]) in an inline_script. In the sequence, you place another inline script with the following code:

       import random
       random.shuffle(stimulus_list)
       choice = stimulus_list.pop(0)
       canvas = self.offline_canvas()
       canvas.image(choice)
    

    and in the run phase of the inline script:

       canvas.show()
    

    Does this help?

    Josh

Sign In or Register to comment.