Colleges and universities that taught students in person this fall found no evidence that the novel coronavirus spread in any significant way in classrooms, laboratories and lecture halls, according to numerous school leaders, easing what had been one of their greatest fears during a deadly pandemic.

A far larger public health problem for higher education, these leaders and other experts say, arose in the off-campus student housing and social scene. Trouble emerged wherever students mingled without protective distance and masks, and faced less peer pressure to curb unsafe behavior.

“What’s utterly clear is that we have no evidence of transmission inside the classroom,” said Daniel Diermeier, chancellor of Vanderbilt University, which invited all students to its Nashville campus and provided a large share of classes face to face. He said dormitories at the 13,000-student school also weathered the challenge.

“If you’re on campus, you’re fine,” he said. Data on the path of infections showed peril elsewhere: “The main issue is off-campus gatherings and parties.”

Around the country, however, many colleges emptied dorms or put them into periods of lockdown to quell campus outbreaks. Lecture halls never filled as large classes moved online.

Lessons from the unprecedented fall term — a massive national quest to balance online and face-to-face teaching in the shadow of a fearsome contagion — are pouring in as the pandemic intensifies, and education leaders are grappling with hard choices about how much to open their classrooms and campuses in the winter and spring. Viral testing, contact tracing, quarantine housing and creative public health campaigns have become the go-to tools of higher education, as essential to operations as course catalogues and tuition payments.

Students and professors are doubly exhausted, from the strain of the forced switch to online courses and from the sacrifices required to stay safe in places that managed to preserve at least a slice of in-person education. About 37 percent of four-year schools taught fully or primarily online in the fall, according to the College Crisis Initiative at Davidson College, and 34 percent taught fully or primarily in person. The rest relied on hybrid teaching and other strategies.

Covid-19, the disease caused by the virus, has killed at least 281,000 people in the United States but so far has been linked to relatively few cases of campus deaths. Faculty warn that schools should not conclude from that glimmer of good news that opening up fully in person is wise or safe.

“Some people seem to feel if nobody dies, it’s a success,” said Richard Williams, a professor of sociology at the University of Notre Dame. “But there are a lot of studies coming out now which seem to suggest covid may have some long-term consequences even for young people.”

The 12,000-student Catholic university in Indiana staged one of the most aggressive campus reopenings in August. But it struggled with surges of infection early in the term, forcing a temporary halt to in-person teaching, and drew national scorn in November when students rushed onto a football field in a mob after a big win over Clemson University.

“We both started the semester poorly,” Williams said, “and ended the semester poorly.”

Notre Dame officials, however, praised students for “completing this most unusual of semesters” and showing “resiliency in the face of challenges.”

Schools everywhere, large and small, are mindful of the danger of the virus.

On Oct. 30, a 20-year-old student named Bethany Nesbitt was found dead in her dormitory room at Grace College, in Winona Lake, Ind. The school, citing a coroner’s autopsy report, said the cause of death was pulmonary embolism, but it acknowledged that covid-19 had played a role.

Nesbitt’s family said in a statement that she had tested positive for the virus. She had shown symptoms of the disease, the family said, and had been evaluated by an emergency-room doctor but seemed to be recovering as she isolated in her room. She watched Netflix on Oct. 29 before she went to bed, her family said, and then a blood clot led to the embolism that took her life. “We speak out not to spread fear,” the family said in a statement, “but to encourage others to exercise enormous caution as COVID-19 cases continue to rise.”

How Nesbitt contracted the virus is unknown. Her family said she had been careful to wear masks, keep at a safe distance from others and follow safety rules. Grace College said it enforced public health rules, including mask-wearing, as it housed about 1,000 students in the fall. It also conducted viral testing of those who showed covid-19 symptoms and found 139 cases among students, faculty and staff over the semester.

Nationwide, experts are racing to understand what works in preventing infections. In June, the Centers for Disease Control and Prevention declined to recommend universal viral testing for students entering a campus, saying it was unknown if that would curtail transmission more than measures such as social distancing, face covering, hand washing and intensive cleaning. In October, the CDC shifted its guidance, telling colleges that “a strategy of entry screening combined with regular serial testing might prevent or reduce” spread of the virus.

The National Academies of Sciences, Engineering and Medicine reported last week that fast, frequent testing can help slow the spread of covid-19 — but must be part of a larger response.

With funding tight, some schools conduct far less viral testing than others. Saint Louis University, with 12,000 students, randomly tested a small share of them each week. It also targeted certain groups for testing when concerns about possible infection arose. That helped the Catholic university in Missouri keep teaching in person. Repeatedly testing everyone “is a waste of money and precious resources,” said Saint Louis President Fred Pestello. He said he was unaware of any covid-19 hospitalizations among students, faculty and staff.

The National Academies report advised following up quickly on test results, so that people who test positive can be rapidly isolated and their contacts quarantined. Hours of delay can make all the difference in the development of an outbreak.

Strong partnerships with local public health officials are essential, the report advised. Schools must also encourage people to wear masks, stay physically distanced from one another, wash their hands and practice other safety habits.

To promote public health, experts say, colleges must bear in mind that students need clear and consistent direction — and that they want to help.

“We haven’t harnessed that enough, the great creativity of our students,” said Dominique Brossard, chair of the department of life sciences communication at the University of Wisconsin at Madison, who examined student behavior for the National Academies. “This is the age where individuals want to be socially active, want to act for good, are aware of the needs of community.”

Brossard said administrators should work with students to give them safe ways to see each other.

“It’s not possible to tell students, ‘You cannot be social, you need to stay in your dorms.’ ”

Many faculty continue to worry. While students craved an in-person experience, said Timothy Yu, professor of English and Asian American studies at the 44,000-student Wisconsin-Madison, “the question of whether that was safe or not is still very much open.”

North Carolina Central University, with about 8,000 students, stayed open this fall even as neighbors in the state university system had to shut down quickly and switch to virtual teaching amid spikes in cases. Leaders of the public historically Black university in Durham said student vigilance made a difference.

KeShaun Coleman, 20, of High Point, N.C., president of the student government association, said student leaders zipped around campus in golf carts at one point, handing out frozen deserts to reward students who were wearing masks and keeping a safe distance. “Our campus community was very conscious of the fact that this virus can easily come to you,” he said.

North Carolina Central tested about 10 percent of its residential students each week for the virus, logging 4,700 tests by the end of the term. Ninety-nine students tested positive, most of them without showing any covid-19 symptoms. One student was hospitalized.

The university found no evidence of classroom transmission. It plans to expand viral testing next semester, said Mari Ross-Alexander, the university’s assistant vice chancellor for health and wellness, “because the numbers are spiking, and we’re not going the right direction as a nation.”

Purdue University made a high-profile announcement several months ago that it would open its campus as widely as possible for an in-person fall semester. Mitchell E. Daniels Jr., president of the 45,000-student public university in Indiana, said the early green light helped enormously for faculty and staff to plan. “Procrastination would have hurt us badly,” he said.

From August through early December, Purdue conducted more than 84,000 viral tests, with 3,121 students and 341 employees testing positive. There were seven hospitalizations and no deaths. “We had zero — zero — infections occur in any of our classrooms,” Daniels said.

There was a difficult stretch in October when Daniels feared students were letting down their guard as they were seen gathering in unsafe clusters at local bars. “Not our finest moment,” he told them in a video Oct. 29. But the university sustained in-person classes until students left just before Thanksgiving.

By the end of the semester, Daniels said, Purdue’s contact tracers were finding that infections appeared to be coming from the surrounding region into the campus area, rather than the reverse.

Over the summer, Daniels recalled, he made a “wiseguy” prediction that if the university prepared for students in the right way, the safest place in Tippecanoe County would be a Purdue classroom. “Well, it probably was,” he said.

Daniels touts the scale of Purdue’s actions to safeguard the campus. More than 800 plexiglass barriers were deployed in classrooms, 2,600 hand sanitizer stations were installed, and many thousands of pieces of personal protective equipment were distributed.

Critics said the university focused on the optics of safety, and they worried that some faculty felt pressured to teach in person. In hindsight, Daniels said, some of Purdue’s steps might not have been necessary to prevent transmission. But he argued that they added to the perception of total mobilization. “We wanted to leave nothing to chance,” Daniels said.

At Cornell University, which has about 24,000 students, officials said teaching in person helped keep the surrounding community in Upstate New York safe. Student surveys had revealed that even if classes were all online, many planned to live in Ithaca for the school year. The university worried students would be far less likely to follow safety protocols if they did not have classes on campus.

So the university launched a robust testing program, converting a laboratory used for animal diagnostics into one that could process tens of thousands of viral tests a week. Cornell chose a front-of-the-nose swab rather than the more invasive nasopharyngeal version, said Gary Koretzky, a professor of medicine and vice provost, to increase student compliance. Undergraduates were tested twice a week in a process designed to be easy and fast.

On a few days, the Cornell dashboard showed, testing turned up a dozen student cases of the virus. Mostly the daily case count among students ranged from single digits to zero. In all, 154 students positive after the semester began Sept. 3.

Like other universities, Cornell found no evidence of classroom transmission. It relied on student leaders, including members of fraternities and sororities, to help promote public health off campus.

What mattered, officials said, was establishing a clear ritual.

“I got tested yesterday,” Koretzky said, “and it literally took less than a minute from when I got to the site to when I left.” Although the tests were required, he said, “making it easy and making it part of the culture was probably more important than the consequences.”