Unless the off-campus apartment is school-owned, there is no reason to believe decisions about in-person classes was made on any connection with leases.
i'll agree at least as it comes to the college town i'm in b/c there is NO LOVE between the university and the local landlords. for the most part the apartments and the houses to rent are privately owned vs. being big companies and those private owners were initially devastated a handful of years back when the university decided to add a bunch more on campus housing-with the kicker being the additional requirement that all freshman had to live ON CAMPUS (not the norm in our neck of the woods). any decisions being made by the university are strictly to benefit the university b/c they couldn't give a c--p about the local town (or their students apparently b/c they just announced that despite all classes being on-line and starting this week-tuition has been increased and is due and payable by tomorrow

I would also think that not fulfilling the contract of the lease would hurt the student's credit scores. The landlords could also take the student to court for breach of contract.
i'm kind of wondering, depending on the state a student attends (and if like mine-the eviction moratorium has been extended a few months more at minimum), if a student whose school has gone distance and doesn't want to live near campus might not give a go at contacting their landlord/rental office and seeing if any negotiation for breaking the lease might be an option. yes, landlords want their money but the reality is the way things are now a student could move in and immediately stop paying rent without any recourse on the landlord's part in my state. whenever the moratorium gets lifted the landlord could start the eviction process but the courts are going to be slammed so it will be much more time consuming and drawn out. a landlord might be very willing to settle a lease for pennies on the dollar.
as far as an eviction hurting a person's credit, who knows? it may be that given the current economic state of affairs that an eviction won't carry near the weight in coming times that it has traditionally. i look to what a home being foreclosed used to do to a person's credit yet when the number of foreclosures skyrocketed during the housing crisis it became/is not as critical a hit.