Yes, but like mentioned above, depending on the context it would probably make more sense to say, "I put up with that idiot in my class." or "I have to put up with that idiot in my class."
But for example you could say something like, "I put up with the idiot in my class until I couldn't take it anymore!"