There’s definitely no need to repeat your two addData lines, since you could just have them at the end to save whatever values you have set for study_score and pairscore.
Try print statements to show curr 9and possibly PretestOverlap, etc) in the console to investigate.