Modify the weight of a vote based on how far the student's votes deviate from the norm over time. A historically positive or negative student would have their vote neutered.
This doesn't prevent one class from ganging up to downvote a teacher on a single occasion, but if that happens that semester's score for the teacher will appear as an anomaly compared to previous scores.