Exploratory Learning Environments (ELE) provide a rich educational environment for students, but challenge teachers to keep track of students' progress and to assess their performance. This paper proposes an algorithm that decomposes students complete interaction histories to create hierarchies of interdependent tasks that describe their activities in ELEs. It matches students' actions to a predefined grammar in a way that reflects students' typical use of ELEs, namely that students solve problems in a modular fashion but may still interleave between their activities. The algorithm was empirically evaluated on peoples interaction with two separate ELEs for simulating a chemistry laboratory and for statistics education. It was separately compared to the state-of-the-art recognition algorithm for each of the ELEs. The results show that the algorithm was able to correctly infer students' activities significantly more often than the state-of-the-art, and was able to generalize to both of the ELEs with no intervention. These results demonstrate the benefit of using AI techniques towards augmenting existing ELEs with tools for analyzing and assessing students' performance.