Dynamics of student modeling: A theory, algorithms, and application to quantum mechanics