You can check if the mouse was pressed in an ImageStim with a code component: https://www.psychopy.org/api/event.html#psychopy.event.Mouse.isPressedIn
# replace myMouse with the name of your mouse component
# replace myImage1 and myImage2 with the names of your image components
# replacePathToImg2 with the name of the column with the image
# paths in your conditions file
imgClicked = pathToImg1
imgClicked = pathToImg2
Then, in a feedback routine, you can check which image was clicked:
# replace pathToCorrectAnsw with the name of the column which defines
# the correct answer in your conditions file
if imgClicked == pathToCorrectAnsw:
feedbackTxt.text = 'Your answer was correct.'
feedbackTxt.text = 'Not even close.'
Disclaimer: I haven’t tested the code, and I don’t know whether it will work for an online study.