I am using Psychopy builder to run my experiment. The problem I am having at the moment is in calculating running averages in task performance.
Here you can see my experiment. CentFix just refers to a central fixation cross and ‘trial’ and ‘trial2’ are two routines holding different types of stimuli. The first loop ‘trials’ loops around 3 times and ‘trials_2’ only loops once. There is then an outer loop to repeat all of this over and over.
What I want to record is average performance on the first stimuli ‘trial’ as well as average performance on second stimuli ‘trial2’. I have used the following code in the ‘end routine’ of a code component in the routine ‘trial2’:
However, what is being recorded in the excel sheet for nCorr1 (average on ‘trial’ stimuli) is average performance over the three trials that are looped over in the first loop ‘trials’. When entering the outer loop ‘trials_3’, nCorr1 resets, rather than taking into account previous trials beforehand. For nCorr2 (average on ‘trial2’ stimuli), it just seems to be recording 0 or 1. I am guessing this is because ‘trial2’ stimuli only has one trial before entering the outer loop, so there is only 1 trial to average over.
How do I get psychopy to continually calculate average performances as the outer loop ‘trials_3’ loops over and over?
I hope that is clear.