. . . Which Makes the End Revelation Gut-Wrenching
Shawn realizes that it's been him all along because he wants Cory and Topanga to get back together. The entire thing ends up being a dream he had while in detention, where he says he disrupted the class in the first place because he feels like he has nothing to depend on if Cory and Topanga aren't a couple.