I’m having an issue with points not accumulating correctly. On each trial 1 or 10 points should be assigned, but after the first trial the points are increasing by 2, 11, or 20 points. I have a nested if…then to determine the number of points based on the response and the stimuli, and I’ve ruled out multiple conditions being met on a trial. I could use some help figuring out why this code isn’t working correctly. This is code in a builder component.
print(mouse.clicked_name[0])
if mouse.clicked_name[0] == 'left_circle':
if (leftStim =="square" or leftStim == "circle"):
print('left_lo')
points_trial = 1
points_cumul += points_trial
elif (leftStim == "star" or leftStim == "hexagon"):
print('left_hi')
points_trial = 10
points_cumul += points_trial
elif mouse.clicked_name[0] == 'right_circle':
if (rightStim =="square" or rightStim == "circle"):
print('right_lo')
points_trial = 1
points_cumul += points_trial
elif (rightStim == "star" or rightStim == "hexagon"):
print('right_hi')
points_trial = 10
points_cumul += points_trial
fback_text = f'+{points_trial}\n{points_cumul} total'
print(fback_text)
and this is the debug output I’m getting:
left_circle
left_lo
+1
1 totalleft_circle
left_hi
+10
12 totalleft_circle
left_lo
+1
23 totalleft_circle
left_lo
+1
25 totalleft_circle
left_hi
+10
36 totalleft_circle
left_hi
+10
56 total