Hi,

I was able to get the points bars to work thanks to jderrfuss and michaelâs suggestions.

They are working great except for one issue:

On the first trial, it does not show the points bars. Its not until the second trial that they show up when you press a key.

Is there a way to fix it so they will show up on their first choice?

Here is my code

Begin Experiment

```
gainstotal = 0
gainstrial = 0
lastTen = []
firstH = 5
h = 0
totsize = [.15, 0]
trisize = [.15, 0]
ypostot = [0.1, 0]
ypostri = [-0.1, 0]
```

Begin routine

```
#for first trial they get 5 pts, after that it will be the number of correct answers in the last ten trials
if trials.thisN == 0: #for first trial, h = 5 #if the first trial is indexed at 0 use 0 otherwise use 1
if key_resp2.corr == 1:
lastTen.append(firstH)
elif key_resp2.corr == 0:
lastTen.append(firstH)
else: #keeping track of corrects
if key_resp2.corr == 1:
lastTen.append(1)
elif key_resp2.corr == 0:
lastTen.append(0)
if trials.thisN < 10: #calculate h (sum of last 10)
h = np.sum(lastTen)
else:
h = np.sum(lastTen[-10: ]) #this is not working
if key_resp2.keys == 'left':
msg1 = "you chose"
msg2 = " "
else:
msg1 = " "
msg2 = "you chose"
```

Each Routine

```
if key_resp2.corr == 1:
gainstrial = 10 + ((70*h)*10)
else:
gainstrial = 30 + ((70*h)*10)
gainstotal = gainstotal + gainstrial
gtotfrac = (gainstotal/600000)
gtrialfrac = (gainstrial/7500)
totsize[1] = gtotfrac
trisize[1] = gtrialfrac
yposc = -(1 - gtotfrac)/2
ypost = -(1 - gtrialfrac)/2
ypostot[1] = yposc
ypostri[1] = ypost
thisExp.addData('trialpts', gainstrial)
thisExp.addData('totalpts', gainstotal)
```