Agent-Based Tutoring Systems by Cognitive and Affective Modeling