Some background info
This is an artificial learning experiment. Four pictures are shown on the screen, participants listen to a sentence from an artificial language and they have to click on the picture that they think matches the auditory sentence. If they pick the correct picture, they will receive feedback. That is, only the target picture will be shown and the sentence will be repeated. This is part of the code I use for that:
while not endTrial:
if mouse.getPressed()[0]:
for n, img in enumerate(target_imgs):
if mouse.isPressedIn(img):
endTrial = True
response = 'target'
feedback(img, target_imgs, target)
for n, img in enumerate(f1_imgs):
if mouse.isPressedIn(img):
endTrial = True
response = 'foil1'
for n, img in enumerate(f2_imgs):
if mouse.isPressedIn(img):
endTrial = True
response = 'foil2'
for n, img in enumerate(f3_imgs):
if mouse.isPressedIn(img):
endTrial = True
response = 'foil3'
The problem
I want them only to get feedback on 75% of their correct responses. So what we’re thinking of is that as soon as the participant selects the correct picture a number will be selected between 0 and 1 and if the number is lower than 0.75 the participant gets feedback and if the number is higher than 0.75 the participant doesn’t get any feedback.
The question
How could I implement that in the current code? Also, if there are other ways to get only feedback on 75% of their correct responses, suggestions are welcome!
Thank you!