Student performance prediction aims to predict students’ future academic performance based on student-related information. With the growing advancement of campus IT applications, the network authentication system on campus is getting more perfect, and universities have accumulated rich data on students’ online behavior. Due to the fact that human behavior and learning ability are highly correlated, from the perspective of campus online behavior awareness, seeks to predict students’ performance by mining their online logs. To this end, we collect a real dataset consisting of both students’ online behavior and performance data, and proves the correlation between them via data analysis. On this basis, we propose an end-to-end dual-level self-attention network (DEAN), which introduces a hierarchical self-attention mechanism to separately capture the local and global characteristics of students’ daily and long-term online behavior, solving the problem of long behavior sequence modeling better. Besides, the multi-task learning is used to simultaneously conduct student performance prediction for different majors under a unified framework, and the cost-sensitive learning is designed according to the difference between students’ rankings to further improve the method performance. Experimental results demonstrate that the proposed method can make more accurate predictions in comparison with the traditional sequence modeling methods.