Howdy, Stranger!

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

Supported by

Help with a task

Hello, I am building a simple task with no answers. I need to add a loop, if I am not mistaken in order for the images to randomize. How can I do that? The task is different sketchpads with color background with different hand images or stop on top and the person that is doing the task just has to put their hands on something that is on top of the table but does not give feedback to the program.

Comments

  • Hi @adrianamartins9995

    Yes, to randomize your images, you’ll want to use a loop item.

    1. Add a loop and place a sequence inside it.
    2. Put your sketchpads inside the sequence (and anything else that is part of a trial).
    3. In the loop table, create a column (e.g., img_name) with the filenames of your images (e.g., apple.png).
    4. In the sketchpad that is supposed to draw the images, use a variable like [img_name] to display the image (view script -> change parameter: file = [img_name]')
    5. Tick the 'randomize' box in the loop to shuffle the order.

    You can check these docs for examples:

    Hope it helps,

    Claire

  • Hi Claire,

    Thank you for your help.

    I have another question, if i need the background to be also randomize can I do the same steps for the background?

    for example I need different color background, blue, yellow, red and green, and a symbol on top that also needs to be randomize.

    Looking forward for your feedback.

    Kind regards,

    Adriana Martins

  • edited April 30

    Hi @adrianamartins9995

    Yes, you can do this in the same way as for the images, by adding more variables to your loop and setting your sketchpads accordingly.

    To change the background, I think you can do it by adding a line like set background "[colour]" to the sketchpad script (see this issue) and change the text parameter of your textline element (if that's what you're using to draw the symbol) to something like text="[symbol]"for the symbol.

    Then add these variables to your loop element (whether you choose a single loop or embedded loops, depending on your experimental design) with the appropriate values.

    As I said, there are plenty of tutorials in the Opensame documentation to help you. If you're still having trouble after trying as hard as you can, you can send me your experiment file and I'll have a look at it and see how I can help you further.

    Claire

  • Hi Claire,

    Thank you for your help. I have built the task as you said but it seems that the file can’t be drawn. It shows the message “ Uncaught “” does not exist in the file pool”.

    The file names and columns are the same. Is there any step that I have missed?

    Kind Regards,

    Adriana Martins

  • edited May 5

    Hi @adrianamartins9995

    It looks like you are specifying the file names incorrectly in your loop table. Make sure that the names include the extension, such as 'uncaught.png', and that the files are actually in your file pool.

    Claire

Sign In or Register to comment.