So many people have strange classroom dreams!
Defecating itself usually means a release of strong emotion and could be a positive symbol believe it or not.
Since this was in class though, I would say this dream may be expressing your feelings about class.
Do you feel you do not have room to express yourself in the class/work setting?
Do you feel as though your emotions (anger?) are spilling over and affecting your work?
Classroom dreams to me usually relate to self-esteem, self-consciousness, and our feelings about our success.
Do you feel ashamed about your performance?
Do you feel unworthy of something?
Do you feel as though what you do is not good enough-- as if you are producing... garbage?