Howdy, Stranger!

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

Supported by

[solved] Randomising questions within a sequence

edited June 2013 in OpenSesame

Hi, just started using Open Sesame, however have very little experience with this kind of thing!

I want to present a series of problems, which i have successfully created within a sequence as text input responses, however while the program runs fine as a list in the order i created the problems, i would like to run the questions in a randomized order.

I assume this is possible, what is the simplest way??


  • edited June 2013

    Hi RichardSteel,

    I'm not very experienced either, and depending on what exactly is to be displayed I don't know if I understand you correctly but I hope this helps:
    One way (depending on if you use forms) would be to randomize the colums list like this:

    #create row array and shuffle rows = [3,4,5,6,7] shuffle(rows)


    form.set_widget(question1, (0,rows[0]),colspan=2) form.set_widget(question2, (0,rows[1]),colspan=2) form.set_widget(question3, (0,rows[2]),colspan=2) form.set_widget(question4, (0,rows[3]),colspan=2) form.set_widget(question5, (0,rows[4]),colspan=2)

    For more info on using forms you can have a look at this:

    Hope this is of some help for you,

  • edited June 2013

    Hi - thanks for the response, however i'm not using forms. What i have is a list of questions contained within a sequence:

    run _text_input_batball "always"
    run _text_input_widget "always"
    run _text_input_lillypads "always"

    So each question exists on a separate page created using the text input function to create a simple question and answer. All this has been created using the GUI.

    So, what i would like to do is present the text input screens in a random, or shuffled order for each participant.

    is this possible?

  • edited 1:07AM

    Hi Richard,

    Refuzee's example shows how to randomize the order of widgets as they appear on a form. A useful tip for sure, but somewhat different from what you need in this particular situation.

    The order of sequence items cannot be randomized. Only loops can have a random order. So what need is to combine a random-order loop, with 'Run if' statements in a sequence item. First, you create a loop that has a variable [my_item], which specifies the item that you want to run on each cycle, like so:


    In this loop (as item-to-run), you add your sequence. But each time that the sequence is executed, you cherry-pick the item that you actually want to run, like so:

    run _text_input_batball "[my_item] = batball"
    run _text_input_widget "[my_item] = widget"
    run _text_input_lillypads "[my_item] = lillypads"

    Does that make sense?


  • edited 1:07AM

    Yes it makes sense, and works perfectly!

    Many thanks

Sign In or Register to comment.