Adding a threshold option and telling participants the percentage of accurate scores after a trial

Hi there,
Thank you to all the help I’ve already received. I was wondering if anyone would be able to inform me how to include a threshold after a practice trial where participants have to get 4/5 correct answers before continuing and how to tell participants what their score was at the end of a trial before continuing on?

In PsychoPy Coder!

Thanks,
Jamie

If you create a :variable: Variable, you can keep track of participants’ score by setting its End Routine value to:

myVariable + int(wasCorrect)

(where myVariable is the name of your :variable: Variable component and wasCorrect is True or False depending on whether the participant was correct this trial)

Then you can just create a routine with a :text: Text component whose text parameter is set to update each repeat and whose value is:

$str(myVariable) + "/5"

and use a :code: Code component to end repeats of the score is sufficient, so having this in the End Routine tab:

if myVariable >= 4:
    myLoop.finished = True

(where myLoop is the name of the loop which repeats the practice trial)