Accuracy feedback after setting 'correct' in inline script
Possibly something very trivial:
I'm using an inline python script to set the accuracy of a response based on where the participant clicks the mouse in the display (using the 'correct' variable). If I then try to give feedback using 'acc', only the last response is provided, not the average. How do I change this to the percentage correct?
Thanks!

Comments
Hi,
You said you're using an inline_script to set the accuracy of a response. Do you mean the accuracy of a single response, e.g. the further away from a target, the lower the acc? If so, then the variable
accis only the last response per definition. Why not create a variable that is updated with every response, so that it represents the average accuracy across trials? You could keep the originalaccvariable, and create a list (before entering the block loop) by means ofresp_accs = [].In the inline script in the block loop, below the line where you create
accyou can add the linesCheers,
Josh
Thanks! It worked when I changed the code slightly:
av_correct=100*sum(resp_accs)/len(resp_accs)
exp.set('Av_acc',av_correct)
Hi Frouke,
You could also use the
set_response()function, which will update the feedback variables automatically:Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!