In short, implement a free market system! Elaboration, let the students choose teachers, and based on the data you get from that, pay the teachers, and have this data out in the open, so teachers can see what influences their remuneration.
Would this not reward teachers who give the students the best experience, rather than the best education. I think it would be naive to expect students to be rational actors* in this market.