Learning-related attention is one of the most important factors influencing learning. While technologies have enabled the automatic detection of students' attention levels, the detected states might fail to be learning-related if students did not attend learning tasks (e.g., the attention level of a student who reads comics secretly during classroom learning). This phenomenon poses challenges to the practical application, especially in the primary school stage, which is crucial for students to set up learning attitudes/strategies. Inspired by the emerging inter-person perspective in neuroscience, we proposed an inter-brain attention coupling method to detect learning-related attention. Our method is based on the premise that learning-related attention should follow the structures of course contents, which is reflected in the attention dynamics shared across students. We hypothesized that one's level of learning-related attention could be detected in the inter-brain attention coupling, which is defined as the degree to which an individual student's attention dynamics match the attention dynamics averaged across classmates. To test this idea, wearable EEG devices were used to monitor students' attention levels in a class of primary school students during classroom learning. We found that one's inter-brain attention coupling was positively correlated with academic performance: higher performances are associated with higher coupling to the class-average attention dynamics. No significant correlation was found between students' attention levels averaged within the individual and their academic performances. These results demonstrated the value of inter-brain attention coupling in assessing primary school students' learning process. We argued that inter-person coupling analysis could be useful in monitoring learning-related attention in real-world educational contexts.