Deductive error diagnosis and inductive error generalization for intelligent tutoring systems