In a large-scale quantitative study that adopted a learning analytics approach, we searched for associations between students' activity in a game-based online mathematics learning environment and their mathematics achievements on a national standardized test. Students were active in the environment throughout the school year, and particularly during an online National Mathematics Olympiad (N = 239 schools). Overall, our findings point to a positive association between online game-based activity during the Olympiad and mathematics test scores. This association remained even after controlling for socioeconomic factors, which are known to contribute to academic achievements. The paper discusses these findings and suggests evidence for causality, in particular cognitive, meta-cognitive, and affective effects of the online activity that may have positively affected test scores.