@Chintham_Tharun, yes it is possible. There are several things to consider when making your image identification Captcha-style trials. Below is a guide for how to do this.
How to position images
In Builder, you can define your stimuli in an Excel conditions file. Each column represents a variable, and each row represents a trial. If you want eight images, then you need eight columns for each image (e.g., image1, image2, etc). For now, the order does not matter. In your routine, you need eight image components, each with their position set in the grid. These are placeholders for your images, and get updated on every trial. They want names like loc1, loc2, loc3 etc - (loc for location). You can call them anything you want, but I call them locations as they set a location for the images on screen.
Are image orders randomised?
For image order randomisation, you need a code component to randomise which image goes to which image component placeholder. Something like:
# Start Routine tab
images = [image1, image2, image3, ...] # etc. Add all your image variables to a list
placeHolders = [loc1, loc2, loc3, ...] # etc
shuffle(images) # randomize the order of the images
# Now you have to loop through the list and set the images to their place holder
for index, image in enumerate(images):
placeHolders[index].setImage(image) # For each placeholder, set the image
How are correct and incorrect responses recorded?
Assuming you have 3 correct answers on every trial, you need to define your correct answers in the conditions file. Add three columns, called corrAns1, corrAns2, and corrAns3. In each, put the correct answer - the filename of the correct image. We refer to these at the end of each trial when we decide whether or not a response was correct.
Add a mouse component to your trial. Set the mouse to never end routine on press, save mouse state on click, and add your placeholder names as clickable stimuli e.g., loc1, loc2 etc. Now, only placeholders (images) can be clicked.
In the every frame tab of the code component, you want to check whether an image has been clicked:
# Every Frame
for loc in placeHolders:
if mouse.isPressedIn(loc):
loc.setOpacity(.5) # fade image to show it was clicked
if len(mouse.leftButton) == 3:
continueRoutine = False # End trial after 3 responses
How to check whether the responses were correct
We can use the code component at the end of a routine to check whether all responses stored in the mouse are correct:
# End Routine
for clicked in mouse.clicked_name: # Check the list of clicked images - will be stored as loc1, loc2 etc
if clicked.image in [corrAns1, corrAns2, corrAns3]: # is the clicked image name in the list of correct answers
response = 1 # 1 for correct
else:
response = 0 # for incorrect
thisExp.addData("responseCorr", response) # store the correct answer in your datafile