The SARS-CoV-2 epidemic has impacted children's education, with schools required to implement infection control measures that have led to periods of absence and classroom closures. We developed an agent-based epidemiological model of SARS-CoV-2 transmission in a school classroom that allows us to quantify projected infection patterns within primary school classrooms, and related uncertainties. Our approach is based on a contact model constructed using random networks, informed by structured expert judgement. The effectiveness of mitigation strategies in suppressing infection outbreaks and limiting pupil absence are considered. COVID-19 infections in primary schools in England in autumn 2020 were re-examined and the model was then used to estimate infection levels in autumn 2021, as the Delta variant was emerging and it was thought likely that school transmission would play a major role in an incipient new wave of the epidemic. Our results were in good agreement with available data. These findings indicate that testing-based surveillance is more effective than bubble quarantine, both for reducing transmission and avoiding pupil absence, even accounting for insensitivity of self-administered tests. Bubble quarantine entails large numbers of absences, with only modest impact on classroom infections. However, maintaining reduced contact rates within the classroom can have a major benefit for managing COVID-19 in school settings.