I'm a beginner in Japanese so I'm trying to read and translate a light novel to improve my vocabulary so I came across this sentence:
As a translation I came up with:
"The other students were heading home after their club activities after spending a peaceful afterschool time when a girl’s scream echoed from the infirmary."
But I'm unsure about this so I have those questions:
Did the other students already leave the school after their club activities or are they still doing them?
What's the function of にと before 平和な放課後を過ごす中?
Is the translation I provided satisfactory?
Thank you in advance.