We have been exploring whether multi voxel pattern analysis (MVPA) of functional magnet resonance imaging (fMRI) data can be used to infer the mental states of students learning mathematics. This approach has shown considerable success in tracking static mental states such as whether a person is thinking about a location or an animal. Applying this to our case involves significant challenges not faced in many MVPA applications because it is necessary to track changing student states over time. The paths of states that students take in solving problems can be quite variable. Nevertheless, we have achieved relatively high accuracy in determining what step a student is on when solving a sequence of problems and whether that step is being performed correctly. Hidden Markov models can then be used to combine behavioral and brain-imaging data from an intelligent tutoring system to track mental states during student's problem-solving episodes.