If you don't have plans to see this movie, you can check the spoilers here and then come back.
This felt like a case where the writers of the movie had a premise with potential and a half dozen or so pretty darn good gags and felt that was enough to go to the well with, figuring they'd fill in the spaces in between as they went. When Bad Teacher is funny it's quite funny, but there's too much padding and meandering to get to the good parts, in the early parts especially; I wouldn't call it an outright failure, but I wasn't enthralled either and am hard-pressed to remember the high points even a few hours later. I'd give Cameron Diaz an A for effort as it feels like she's really straining to get all she can out of the script and she works a subtle comedic side I wasn't sure she had in a movie that needs it; she doesn't have the most natural charisma and a few scenes calling for her to be the bouncy sexpot she was a decade ago fall flat, but I was more interested in her playing a new role. The strength of the movie is in the casting of the supporting cast, as Lucy Punch is unstoppable once she gets on a role and Jason Segel is brilliantly effortless in the way he can make even scripted scenes seem completely off-the-cuff. Justin Timberlake was good if somewhat miscast as the straight man, while Eric Stonestreet and Thomas Lennon were straight up scene stealers. The only real acting disappointment for me was John Michael Higgins, who is capable of better. So a generally strong cast who showed the full potential of the idea when the script came together, but unfortunately that only happened about every other scene at best.