Giving feedback adding points collected in every round

Hi Michael! Thanks for you answer.
Here is the code, I did’t know how to format it, thanks.

Code in the trial1 routine:
Begin experiment:

gainsThisRound=0
gainsTotal=0

Begin routine:

if resp.corr:
   gainsThisRound=gainsThisRound+100
else:
   gainsThisRound=0

End routine:

gainsTotal=gainsThisRound + gainsTotal
thisExp.addData('gainsTotal', gainsTotal)

Then in the gains1 routine I put a text with $gainsTotal

The other thing I tried:
Code for trial1 routine:
Begin experiment:

gains=0

Begin routine:

if practice.thisN==0
   number_correct = 0

End routine:

if resp.corr:
   number_correct = number_correct + 1
else:
   number_correct = number_correct

Code for gains1 routine:
End routine:

gains = number_correct *100 #every correct answer gives you 100 points

In this routine (gains1) I put a text with $gains

I tried doing what you suggested, putting the code also at the End of routine but it still shows only 0 as a feedback.

1 Like