Bart presents a book report at Springfield Elementary School on Treasure Island, but it is blatantly obvious he did not read the book. Mrs. Krabappel proves her suspicion when Bart is unable to answer her question about the name of the pirate in the book. After school, Mrs. Krabappel tells Bart his grades have steadily gotten worse and warns him about an upcoming exam on Colonial America, but Bart does not pay attention. Bart procrastinates, watching cartoons and frequenting the video arcade. At dinner, Lisa presents a test she got with an A, and Homer rejoices by putting her test on the refrigerator, covering up Bart's only accomplishment of a crude cat drawing he had done years earlier, showing his lack of schoolwork. Bart only briefly opens up his history textbook before falling asleep. The next day at school, Bart escapes the test by feigning illness. He is sent to the nurse, who diagnoses him with amoria phlebitis and sends him home. At home that night, Lisa warns Bart he cannot evade his responsibilities forever, but Bart calls Milhouse for the test answers. After school the next day, an overconfident Bart hands in his test, only to get a poor score that is even worse than Milhouse's substandard test and have Mrs. Krabappel take remedial action.
Homer and Marge are called in to meet with Mrs. Krabappel and school psychiatrist Dr. J. Loren Pryor. Dr. Pryor says that Bart is an underachiever and recommends that he should repeat the fourth-grade. Homer and Marge consider that holding Bart back might not be such a bad idea. However, Bart is against this idea, and vows that he will start to do better and will pass. In desperation, he asks Martin Prince for help. Martin agrees to help in exchange for Bart showing him how to become more popular. The two initially help each other out, such as Martin showing Bart about highlighting and other ways to be a serious student, but Martin starts to take on some of Bart's poor character traits. He decides to stop being a bookworm and hang out with his new friends and play practical jokes, and forsakes Bart. Left with little time to study on his own, Bart prays to God and asks that something miraculous happen to make him miss school the next day so he can have more time to study. That night, Springfield is hit with a massive blizzard, and the schools are closed.
After receiving word of the school closures, Bart prepares for a fun snow day. However, Lisa reminds him of his prayer, and Bart decides to make good with God by studying while everyone is outside having fun. Bart tries to focus while he is studying, such as unsuccessfully imagining himself as a member of the First Continental Congress during the Declaration of Independence. Bart needs to slap himself to keep his attention span on track and be serious about studying, which is noticed by the family looking through the window at how much Bart strives. The next day, he finishes the test and asks Mrs. Krabappel to grade it immediately. She does so, and tells him that he gets a 59, failing by just one point. Upset at having failed despite all his efforts, Bart breaks down in tears; Mrs Krabappel is stunned to see him cry and tries to console him. Bart compares his failure to George Washington's surrender of Fort Necessity to the French in 1754. Mrs. Krabappel, stunned at this obscure historical reference, realizes that Bart does make an honest effort after all. She gives Bart an extra point for demonstrating applied knowledge, pushing his grade up to a D minus, barely passing. A proud Bart without thinking kisses Mrs. Krabappel on the cheek before running throughout Springfield, exclaiming to people that he actually passed. As the family watches, Homer proudly displays Bart's new personal best on the refrigerator, and Bart declares that "part of the D minus belongs to God".