Summary: Drawing on Bandura’s triadic reciprocal causation model, perceived classroom environment and three intrapersonal factors (mathematics self-efficacy, maths interest and academic self-concept) were considered as predictors of test performance in two correlated mathematics assessments: a public examination (GCSE) and an on-line test, both taken by UK pupils at age 16 ($n=6689$). Intrapersonal factors were significantly associated with both test scores, even when the alternative score was taken into account. Classroom environment did not correlate with mathematics achievement once intrapersonal factors and alternative test performance were included in the model, but was associated with subject interest and academic self-concept. Perceptions of classroom environment may exercise an indirect influence on achievement by boosting interest and self-concept. In turn, these intrapersonal factors have direct relationships with achievement and were found to mediate the relationship between perceived classroom environment and maths performance. Findings and their implications for mathematics education are discussed.