Howdy, Stranger!

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

Supported by

[solved] Randomizing pictures on one sketchpad

edited May 2013 in OpenSesame

Hi, Sebastiaan,

In my experiment, I create a sketchpad to present 2 pictures each time. Furthermore, the 2 pictures come from the same 9 files. I set two level loops for the 9 files in random orders. However, the 2 pictures show the same one file on the screen sometimes, and I don’t want to see that.

Could you teach me how to solve the problem, please? Thank you so much. By the way, I'm using OpenSesame 0.27.2.

Best regards,

Peter

Comments

  • edited 10:23PM

    Hi Peter,

    There are several ways in which you can make sure your stimulus pairs will never consist of two identical pictures. Below I will give two suggestions.

    Firstly, you could adapt your loop table such that you manually remove all the cycles in which the first and the second image are the same. More specifically:

    1.) Use the variable wizard in your block loop to create a table containing all possible combinations of the two images. For more information about the variable wizard, see for example Step 3 in the the step-by-step tutorial .

    image

    2.) Manually remove all the combinations in which the variables image1 and image2 (or whatever you called them) have the same value (for example, 'pict1'). Next, change the number of cycles to the new number of possible image combinations (in your case, this will change from 81 to 72).

    image

    3.) Use the square-bracket method to present the two images in your sketchpad adapting the sketchpad script to something like the following (for more information see for example Step 6 in the the step-by-step tutorial):

    set duration "0"
    set description "Displays stimuli"
    draw image -320 0 "[image1].bmp" scale=1 center=1 show_if="always"
    draw image 224 0 "[image2].bmp" scale=1 center=1 show_if="always"
    

    A working example experiment using this method is uploaded here (download, change the extension from .txt into .opensesame, open as normally and add four images called 'pict1.bmp', 'pict2.bmp', 'pict3.bmp', and 'pict4.bmp' to your file pool):

    Alternatively, you could use Run-if statements to indicate that the items in your trial sequence (such as your sketchpad, and for example, a keyboard_response item) should only be run under certain conditions (in your case, when the stimulus pair does not consist of two identical pictures).

    More specifically:

    1.) Create a loop table as described above.
    2.) Create a sketchpad item as described above.
    3.) Use the Run-if-statement boxes in your trial sequence item to indicate that the trial items should only be run when the first image is not (!=) the same as the second image, like so:

    image

    For more information about conditional statements, please see this article:

    A working example experiment using this method is uploaded here:

    Does this help? Please let us know if you have any more questions!

    Best,

    Lotje

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited 10:23PM

    Hi Lotje,

    It works! I really appreciate your help! The first way is great to my experiment. Thank you so much!

    Best regards,

    Peter

  • edited 10:23PM

    Great! Good luck with your experiment and don't hesitate to ask any other questions.

    Did you like my answer? Feel free to Buy Me A Coffee :)

  • edited 10:23PM

    Thanks again for your kind help. I will keep going and do my best.

Sign In or Register to comment.