You could measure satisfaction of the need for relatedness in an educational context using the Need Satisfaction and Frustration Scale (Longo et al., 2016, Journal of Happiness Studies).
Lee, R. M., & Davis, C. (2000). Cultural orientation, past multicultural experience, and a sense of belonging on campus for Asian American college students. Journal of College Student Development, 41, 110-115.
Lee, R. M., Draper, M., & Lee, S. (2001). Social connectedness, dysfunctional interpersonal behaviors, and psychological distress: Testing a mediator model. Journal of counseling psychology, 48(3), 310-318.