Antecedent-Consequent Relationships and Cyclical Patterns between Affective States and Problem Solving Outcomes