Mrs. Krabappel's positive attitude is crushed when she sees her students distracted from class by their cell phones, so she takes the devices away and puts them in the drawer with the biology frogs. This angers Bart and the other children, and they decide Mrs. Krabappel needs to "chill out". Bart understands that Homer is goofy and easy-going once he has had a few beers, so the students decide to spike Mrs. Krabappel's coffee with liquor they steal from their parents. The next day, once she has consumed a mug of heavily-spiked coffee (with sly encouragement from the kids), Mrs. Krabappel becomes very intoxicated. She sings a loud, off-key, incoherent version of "This Old Man" with her students, and ends up hitting on Dewey Largo and disrupting an assembly bidding farewell to foreign exchange students. Principal Skinner is forced to fire her, although reluctantly, even giving her his hankey when she starts crying.
Principal Skinner replaces her with a hip recent graduate of Tufts University named Zachary Vaughn. The students are immediately impressed with Zack, as he returns their cell phones and instructs them to use their electronic devices for classwork; his first assignment to them is “Twenty minutes of Twittering”. Bart raves to his mother about how much fun it is to have Zack as a teacher, but Marge worries about Mrs. Krabappel's well-being, and Lisa doubts Zack's ability to teach. Bart goes to visit Mrs. Krabappel and is stricken with guilt when he sees her moping in front of the television. Bart and Milhouse meet at a bookstore (where Moe is revealed to be a fan of Doris Kearns Goodwin) and decide to get Mrs. Krabappel rehired. They buy a self-help book entitled "The Answer" (a spoof of "The Secret"), which professes to have all the answers to help someone achieve their dreams. Mrs. Krabappel is initially skeptical, but reveals her dream is to open a muffin shop. Some time in the future, she successfully opens a muffin shop which attracts several Springfielders including Ned Flanders. Bart inadvertently confesses that he had the idea to spike her coffee with alcohol and therefore is responsible for getting her fired. Mrs. Krabappel is furious and tells him that her real dream was to be a teacher, and is now facing heavy debt as well as competition from other newly-opened muffin stores. Destroying the self-help book, Krabappel declares that Bart is the only kid she has ever met who is "bad on the inside".
Bart is deeply troubled by Mrs. Krabappel's statement, and decides to get her old job back by spiking Zack's "Blue Bronco" energy drink, but instead decides to tell Principal Skinner the truth and face punishment. Principal Skinner is pleased that Bart was honest and agrees to punish him for it, but tells him he cannot just rehire Mrs. Krabappel when Zack is doing a good job in her place. Skinner is about to punish Bart and when it seems Krabappel would never get re-hired, their conversation is suddenly disrupted by a belligerently drunk Zack — who ironically secretly mixes vodka in his own drink — who mocks the schoolchildren and tells them they have no future because their education will not help them achieve real things in life. Groundskeeper Willie drags Zack away with the remark "It's always the good ones that go crazy the fastest", and Mrs. Krabappel is reinstated. Bart hopes that there will be no hard feelings between Mrs. Krabappel and himself. She responds by making every student in the class eat a stale muffin, as part of her "muffin-based revenge", as the end credits style of text mimics that of The Secret.