Several OpenSesame questions for logger and randomized images
I am currently working on an experiment for a project. The task I am putting together is a bit complicated, and I am very new to this software, so I have a few questions.
First, I want to create a sketchpad that displays a circular array of 8 images all at once, but they need to be randomly drawn from a selection of 12 images. I have created an inline script with this code:
My images are randomized right now, but I want only 8 to show up at a time from a selection of 12. And it is very important that every trial has a specific number of positive, negative, and neutral images. Such that every trial has 2 positive, 2 negative, and 4 neutral images. I'm not sure how to specify all that in an inline script or if I even need to use one.
My second issue is that I want to record the participants' average accuracy scores for each trial. The problem is that the "correct" response differs on every trial because an arrow will cue the participants to the image they need to select. I have a logger included in my experiment, but I am not sure how to specify what the correct response would be since the correct response depends on the random arrow cue.
I would greatly appreciate any advice for either question, and I hope I am on the right track! Thank you to anyone who reads this!
Comments
Hi @anna_snow
At the moment, your inline script is only shuffling four images (all_images) and assigning them to four positions. To get 8 images out of 12 with condition constraints (e.g. 2 positive, 2 negative, 4 neutral), you’ll need a slightly more elaborate inline script.
I would suggest that you first split images by condition in an inline script at the beginning of the experiment, so that you have 3 lists (e.g., pos_images, neg_images and neut_images). In another inline script at the start of each trial, you can then randomly sample the required number of images from each condition list, and shuffle their positions.
Now how complex the inline script needs to be really depends on your intended design (e.g., whether all possible combinations should appear across the experiment or if you want something fully random; sometimes it may be cleaner to use a structured table/loop instead) but I’ll need a bit more information to give you a concrete solution.
For the accuracy question: the easiest solution is usually to define the correct target dynamically during the trial. For example, you could store the cued image (or position) in a variable when the arrow is shown (or retrieve it if the variable already exists in a table loop), then compare the participant’s response to that variable in a short inline script placed after the response, and compute the mean accuracy at the end of the trial if there are multiple responses per trial.
If you can share your experiment file, that would make it much easier to see the overall structure and give you more specific advice.
Cheers,
Claire
Check out SigmundAI.eu for our OpenSesame AI assistant! 🤖
Hi @cvanbuck !
Thank you so much for your help!
As for the design, my two variables in the loop table are cue delay x target condition (positive, neg, neutral), and I want an equal number of all possible combinations to happen.
I have 12 total images (4 positive, 4 neg, 4 neutral), and I want 8 images to appear on screen at once, such as there is 1 pair of the same positive image, 1 pair of the same negative image, and 2 pairs of the same neutral image. The images should randomly appear at one of 8 fixed locations on the sketchpad.
Here is the file:
Thank you!!!!!!
Hi @anna_snow
Here is a working example that you can adjust to show eight images instead of four. Depending on your exact experimental design, you may need to make other adjustments, but at least you get the general idea.
I hope this helps!
Claire
Check out SigmundAI.eu for our OpenSesame AI assistant! 🤖
Hey @cvanbuck
I'm having a hard time opening and running that experiment. Is there any way you could copy/paste the code you used?
Thanks,
Anna