Research shows that emotions play an important role in learning. Human tutors are capable of identifying and responding to the affective states of their students; therefore, for ITSs to be truly affective, they should also be capable of tracking and appropriately responding to the emotional state of their users. We report on a project aimed at developing an affect-aware pedagogical agent persona for an ITS for teaching database design skills. We use the dimensional approach to affective modeling, and track the users' affective state along the valence dimension as identified from tracking the users' facial features. We describe the facial-feature tracking application we developed, as well as the set of rules that control the agent's behavior. The agent's response to the student's action depends on the student's cognitive state (as determined from the session history) as well as on the student's affective state. The experimental study of the agent shows the general preference towards the affective agent over the non-affective agent.