count_transitions function

Count transitions between pre and post test responses