Professor Laurie Santos teaches “Psychology and the Good Life” at Yale University in New Haven, Conn. By enrollment, it is the most popular course ever offered at Yale, with more than 1,200 students taking the class. (Stan Godlewski/For The Washington Post)

Laurie Santos greeted her Yale University students with slips of paper that explained: No class today.

It was mid-semester, with exams and papers looming, everyone exhausted and stressed. There was one rule: They couldn’t use the hour and a quarter of unexpected free time to study. They had to just enjoy it.

Nine students hugged her. Two burst into tears.

Santos, a professor of psychology, had planned to give a lecture about what researchers have learned about how important time is to happiness. But she had created a singular class, on the psychology of living a joyful, meaningful life. And she wanted the lessons to stick. All semester, she explained why we think the way we do. Then, she challenged students to use that knowledge to change their own lives.

So canceling class was not just a break, it was an immersion. And it was a provocation: She was asking them to stop worrying about grades, even if only for an hour.

Sophomore Maeva Forti of Boston meditates daily as part of the changes she has made while taking “Psychology and the Good Life” at Yale. (Stan Godlewski/For The Washington Post)

A senior went to the Yale University Art Gallery for the first time in her four years in New Haven. A group of students went to a recording studio on campus and jammed out a new song.

Leonardo Sanchez-Noya, a senior who had skipped lunch that day because he had been studying, was delighted to have the time to eat a hamburger, and to play Frisbee. All over campus, he said, you could see people relaxing. More people were outside, more people were smiling.

That’s because some 1,200 students were simultaneously taking Santos’s “Psychology and the Good Life” class.

It’s the largest class, by far, in Yale’s 317-year history.

On that spring afternoon, nearly a quarter of the undergraduate student body was enjoying an unexpected break at the same time. No, not just enjoying it — really loving the gift they had been given. Skyler Robinson, a sophomore, had for a moment been confused by all the possibilities it opened up. He felt very, very happy. Then, he took a nap.

“That nap,” he said, “was fantastic.”

* * *

Santos designed this class after she realized, as the head of a residential college at Yale, that many students were stressed out and unhappy, grinding through long days that seemed to her far more crushing and joyless than her own college years. Her perception was backed up by statistics, including a national survey that found nearly half of college students reported overwhelming anxiety and feeling hopeless. Santos thought she could share recent findings from psychology to inform the choices students make, to help them enjoy life more.

“I worry so much how they’re going to look back on it,” she said — the stone archways and brilliant scientists, the Picassos and Mondrians and stained glass glowing in the art gallery, the symphonies and parties and friendships and theater and everything that’s beautiful about Yale and college life. “They feel they’re in this crazy rat race, they’re working so hard they can’t take a single hour off — that’s awful.”

The idea behind the class is deceptively simple, and many of the lessons such as gratitude, helping others, getting enough sleep are familiar.

It’s the application that’s difficult, a point Santos made repeatedly: Our brains often lead us to bad choices, and even when we realize the choices are bad, it’s hard to break habits.

All semester, hundreds of students tried to rewire themselves — to exercise more, to thank their mothers, to care less about the final grade and more about the ideas.

Did that lead to skepticism, snark and derision? Yes, lots.

But in ways small and large, silly and heartbreakingly earnest, simple and profound, this class changed the conversation at Yale. It surfaced in late-night talks in dorms, it was dissected in newspaper columns, it popped up, again and again, in memes.

“A lot of people are waking up, realizing that we’re struggling,” said Robinson, who plans to go to the Navy’s Nuclear Power School and become a submarine officer.

There’s no longer the same stigma around mental-health issues, he said. “Now, so many people are admitting they want to lead happier lives.”

In a way, the class is the very essence of a liberal-arts education: learning, exploration, insight into oneself and the world. But many students described it as entirely unlike any class they had ever taken — nothing to do with academics, and everything to do with life.

The impact is not limited to Yale. Stories about PSYC157 spread around the world. Santos created a pared-down version of the class and offered it to anyone on the online education site Coursera.

Within two months of its launch, more than 91,000 people, from 168 countries, were taking it.

And so at the end of the semester, Santos asked the students of this most famous, most infamous class at Yale (as she described it): Did it work?

Did one class, full of simple ideas, teach them how to live the good life?

* * *

On the night before the last class, sophomore Maeve Forti settled onto the fuzzy blanket on her bed, closed her eyes, put her palms on her knees and began to meditate.

The last wave of finals and papers was about to wash over her, and things were already piled up in her room to be packed, because her summer internship in Boston began immediately after exams ended. Despite the overwhelming sense of everything she had to do, she cleared a space.

“It’s going to improve my mood, it has other great effects, it’s something I should be prioritizing,” she said. “But like a lot of other things in the course, it’s very easy to say, ‘I don’t have time.’ ”

No one has time. But in this class, they not only learned about the psychology behind the choices they were making, they actively tried to change their behavior.

Santos — a funny and engaging lecturer, the kind of warm and joyful person who will alert students in her residential college if there’s a really soft dog in the courtyard they should get outside and pat — is able to cut through much of the skepticism about touchy-feely nonsense with a combination of hard data, silly photos and a ready laugh.

She taught students about cognitive biases.

“We called it the ways in which our minds suck,” Forti said. “Our minds make us think that certain things make us happy, but they don’t.”

It’s hard to live up to the expectations they set for themselves, another student said, and they pile on more stress by constantly comparing themselves with their classmates.

Then, they had to apply the lessons. One week, Santos asked students to exercise regularly. Another week, to get three nights with seven hours of sleep. After showing them data suggesting how much moods can improve from even a fleeting social interaction, she asked students to reach out to a stranger.

They wrote letters of gratitude. Forti wrote to her mother; the tears started at, “Dear Mom.”

There was a palpable difference on campus, several students said, during the week when they performed random acts of kindness.

Santos said students were most skeptical of the idea that good grades aren’t essential to happiness. (And when she joked she was going to teach them that by giving everyone a D, she was flooded with calls from freaked-out students and parents.)

Some changes, of course, didn’t stick. As finals approached, Robinson stopped writing in his “gratitude journal.”

But people worked hard to maintain some new habits. When Robinson first tried to meditate on a busy day, it made him almost angry — he felt it was wasting the time. But as days passed, he found it was making him calmer, more in control. And he kept going to the gym.

Forti deleted her social media apps, tempted by Snapchat but appreciating time with friends more.

Lakshmi Rivera Amin, a first-year student, realized how much she missed playing piano. She used to practice an hour or two a day at home, but she had been too busy at Yale. Now, she sets her alarm half an hour earlier.

“I feel different physically and mentally — I don’t feel so weighted down by things,” she said. The biggest misconception people have about the class is that Santos is offering some kind of easy happiness fix. “It’s something you have to work on every day. . . . If I keep using these skills, they’ll, over time, help me develop better habits and be happier.

“I hope they’ll stay with me the rest of my life.”

* * *

Half an hour before Santos’s last class, the quiet memorial plaza by the rare-book library and the stately president’s house began to buzz as students streamed into Woolsey Hall. The Verve’s “Bitter Sweet Symphony” was playing from speakers under the hall’s soaring arched ceiling. Sunlight poured through enormous windows, giving an extra glow to all the gilded surfaces.

This concert hall, with the golden pipes of an organ rising behind the stage, was the only space school officials could find for such a large class. At the beginning of the semester, Santos watched the tool that graphed its enrollment change — 100, 200, 500. She worried there wasn’t a big enough classroom, but an administrator said, “We are not going to cap the happiness class!”

For a class that emphasizes an appreciation of beauty, and the importance of community, it has been a perfect setting.

Forti sat in the front row with her eyes closed, meditating.

A crew of two dozen teaching fellows was dashing around, handing out quizzes. Santos asked those who already had a copy to meditate on their best possible selves, instead of worrying about grades.

Santos mentioned their last reading assignments, including Dr. Seuss’s joyful classic, “Oh, the Places You’ll Go!” She reminded them of how she had started the semester by juxtaposing the words of the school’s unofficial alma mater, “Bright college years/with pleasure rife/The shortest, gladdest years of life,” with bleak national data about college students’ subjective well-being.

She wondered how to end such a class — what was she supposed to do, give them the secret to happiness? — and joked she would just turn on Kanye West’s “Good Life,” mic drop and give them all Ds.

She made fun of herself not practicing what she was teaching them, as she struggled with the demands of this enormous, ambitious new course. She showed them a photo of herself holed up working on Christmas, and another of herself covered in students’ papers after midterms.

She read them a gratitude letter she had written — to the class, for inspiring her with their willingness to make changes, and giving her life so much meaning this semester. “Awwwwww,” hundreds of people said in unison.

Santos told them she was creating a center for the good life at the residential college she leads at Yale, and that people had already volunteered to help teach students skills for managing stress.

As for the good life, she told them they already know how to live it — they just have to practice, put in the hard work.

So many students have told her the class changed their lives. “If you’re really grateful, show me that,” she told them. “Change the culture.”

“Let’s do this!” she said. (Cue the photo of a kitten leaping.)

“Good Life” began blasting into Woolsey Hall, and more than a thousand Yalies stood up, some laughing, some crying, all applauding. Finals were happening, papers were due, internships and jobs were imminent. Later, they would pour out into the sunshine, hurrying to other classes or exams or the library, and Santos would hug her husband and promise him a date night. But for now students stood and clapped and clapped and clapped, beaming, drowning out even Kanye with their standing ovation. As if they had nothing but time.