psychopy.org | Reference | Downloads | Github

Provide cumulative feedback in a trial by trial basis

Hi all,

I need to provide participants with feedback in a trial by trial basis, and keep a score of their correct and wrong answers, so that they can see, after every response (but also at the very end of the experiment), how many correct and wrong answers they have “collected” so far.

At the end of the feedback trial I have added the following code component:

    if key_resp.corr== 1: #stored on last run routine
        green_score = green_score + 1
        print(green_score)
    else:
        if key_resp.corr==0:
            red_score = red_score + 1
            print(red_score)

But keep getting 1 as output of print

At the beginning of the feedback component I have (of course) created the two lists:

red_score = 0
green_score = 0

What should I add to my code so that it adds 1 to either the list green_score or red_score after each trial?

I now understood what the problem is: the two lists need to be added at the beginning of the experiment, and not at the beginning of the feedback trial :slight_smile: