Colleges run on routines and rituals.

Students and parents watch the calendar from drop-off day through graduation, one term after another. Midterms come and go, and spring break offers a respite before the last push to final exams and summer.

The coronavirus pandemic smashed all the routines this week, forcing hundreds of thousands of undergraduates to scatter from campuses around the country, return from study abroad and hunker down at home. They will still be taking classes, but remotely, with cellphones and laptops for at least a few weeks and perhaps the rest of the school year.

“I don’t want to go home,” said Rebecca Gibbons, a freshman from the Eastern Shore studying chemical engineering at the University of Maryland. She was among the stunned students packing up this week without any idea of when they’ll return to College Park. “I just know that being in class and being able to ask questions and being able to physically see the professor writing down every step is important. It’s just going to be very difficult.”

On Friday, the fast-moving crisis rocked another public flagship. The University of Texas shut down abruptly, just before spring break, because it had its first confirmed case of covid-19.

“It is difficult for me to write this because the person who tested positive is my wife Carmel,” UT President Gregory L. Fenves wrote in a message to campus. “And a second member of my family (who works at UT) is presumed to have COVID-19 as well. I have now been tested for the virus, and the three of us are in self-isolation.” UT added an extra week to spring break and is shifting many lectures online.

That dramatic announcement followed days of drama that have convulsed campuses from coast to coast and even threatened commencements.

“It is an earthquake,” said William E. “Brit” Kirwan, a former university president and retired chancellor of the University System of Maryland.

Schools faced upheaval after the September 2001 terrorist attacks and Hurricane Katrina in 2005. But this crisis feels different because its full dimensions are still unknown.

“It’s developing so fast that what we thought was true yesterday or last week is no longer true,” said Mary Sue Coleman, president of the Association of American Universities.

At U-Md., students said their goodbyes Thursday and hauled gear out of dormitories to get ready for the unexpected online phase of their year when classes resume March 30. For at least two weeks, there will be effectively no in-person teaching at the 41,000-student university.

Some suspect the separation will last much longer.

“I don’t think it’s hit me that we probably won’t see each other for the rest of the semester,” said Muhannad Alsenan, gesturing to fellow freshman Chase Wilson as they met outside Elkton Hall.

Alsenan, 18, a computer science major, said he’ll take a train or a bus home to Hershey, Pa. Wilson, 18, of Annapolis, Md., who is studying aerospace engineering, said he expects the outbreak to get worse before it gets better. “I’m packing everything,” he said.

Among the first to feel the effects: those studying in China, South Korea, Italy and other hard-hit countries. Thousands have been forced to fly home early since the outbreak originating in China gathered momentum in January and began to spread around the globe.

Some European airports were a madhouse this week after President Trump called a halt to most travel from Europe in a bid to slow the spread of the virus. Europe is the most popular study-abroad destination for U.S. students.

This week, as the outbreak intensified in the United States, growing numbers of colleges and universities took unheard-of measures to reduce the risk of transmission through public gatherings. Administrators said they wanted to get ahead of the problem before it became too late. They saw dormitories, dining halls, classrooms and other campus meeting points as obvious places where the virus could spread, endangering not just the campus but neighboring communities.

Princeton University, in New Jersey, announced Monday it will switch to online teaching, and it encouraged students to stay home after spring break. That set off a torrent of similar announcements as many schools moved to suspend in-person teaching for at least two weeks or even the duration of the school year. Among them were major public universities and systems in New York, Florida, Maryland, North Carolina and California.

By Friday, the rush to online teaching affected more than 1 million college students.

Questions and criticism instantly arose. Many parents pay more than $60,000 a year for tuition, room and board at private colleges to help their children obtain a top-notch residential education. Other students receive significant financial aid and rely on meal plans and university housing.

Stanford University, in California, published frequently asked questions after it switched to remote teaching. One touched on money: “Will tuition be reduced since classes are online only?”

The answer: “No, we are not going to reduce tuition.”

But Stanford said it would reduce room and board bills for the spring quarter in proportion to the number of days students are not living on campus.

Throughout the country, some parents complained their children were being essentially evicted even though they had paid for housing and meals. Colleges sought to assuage those concerns, offering help for students in financial need. But frustration boiled over.

Frances Gleeson, 57, an interior designer from Bethesda, Md., said she had to take Thursday off to retrieve her children. One is a freshman at U-Md. and the other a junior at American University in the District.

“They should have been able to manage the kids here,” Gleeson said as she loaded her car outside a dorm in College Park with bags and boxes of ginger ale. “That would have been a wiser choice than mass hysteria.”

Gleeson is self-employed.

“If I don’t work, we don’t eat,” she said. “I’ll be feeding the kids for months that I did not anticipate having to pay for.”

At Princeton, the volatile situation jolted students. An online petition urged school officials to reevaluate the weight of midterm exams.

As exams took place, some students wrote in the petition that the burden of unexpectedly packing to leave campus for at least a few weeks, making travel plans and worrying about the virus was hurting their ability to study. One wrote that she was so paranoid about catching the virus and unknowingly bringing it home to a brother with a chronic illness that she was avoiding friends and the dining hall and was scared to go to a classroom to take an exam.

At Harvard, where students were told to clear out by the weekend, the pace was frantic.

“People are very confused, they’re very frustrated,” said Ifeoma White-Thorpe, a junior from New Jersey. The news was shocking for young people “being evicted from their college campus,” she said. Harvard made exceptions for some students to stay.

The Harvard Undergraduate Council held an emergency meeting to brainstorm ways to push the administration to help students. The council is steering some surplus funds to help low-income students cover the unexpected cost of storing their things. Harvard had helped with much of the cost, and the council decided to make up the rest.

White-Thorpe said a friend from Burundi does not have WiFi at home, so she was trying to decide whether to go to another country or try to rent an apartment in the United States.

Students were not the only ones scrambling. Faculty everywhere were moving into overdrive to brush up on their online teaching techniques — or, in the case of some stuck-in-their-ways veterans, learn those skills for the first time.

In the past decade, digital tools have seeped into higher education in many ways. It’s not unusual for a college student to take an online class or to watch lectures stored on a video archive. But what faculty are now attempting — to change methods midstream on a mass scale, ditching face-to-face teaching within a week or two — has few precedents.

Terry Johnson, a bioengineering professor at the University of California at Berkeley, will be lecturing from his laptop to 150 students in three classes.

“For me, the goal is for the campus to get through a very difficult semester, consistently having patience and empathy for students and colleagues and the people all around them,” Johnson said. “If we can do that, that’s all we can expect from ourselves.”

At Georgetown University, Jacques Berlinerblau, a professor of Jewish civilization, team-teaches a course on black-Jewish relations. He fears digital barriers thrown up between professors and students will hinder efforts to draw students out in discussions — a hallmark of the education universities prize.

“Can the technology accommodate the rather dramatic shift in pedagogical style that some of us have adopted over the past decade — the move from passive learning to active learning?” Berlinerblau asked. “I’m going to guess that the answer is no.”

For college administrators, the challenges are enormous. They must protect their communities, keep the academic calendar on track, ensure that a new class of students is recruited, watch out for fiscal perils (including the possible cratering of international enrollment) and decide whether and how to hold graduation exercises.

Sizing it all up, Berea College in Kentucky canceled the rest of the school year and decided to scrap or postpone commencement in the interest of protecting the community. Graduates will get their diplomas in the mail, but the college said it hopes to “find a way to celebrate” at a later point. On Friday, the University of Michigan canceled its commencement.

James E. Ryan, president of the University of Virginia, acknowledged that the dispersal of students will hit graduating seniors especially hard.

U-Va.’s graduation weekend is scheduled to start May 15. On Thursday, the university said it would decide what to do by April 15.

“I cannot pretend, obviously, that this is how I hoped this semester would unfold,” Ryan wrote to the U-Va. campus. “No one can.”