Pay solution:<p>Since teaching quality increases when classes are small and decreases when classes are large, we can adjust class sizes to equalize the quality delivered by each teacher.<p>Having equalized the quality, we now simply pay teachers for the number of students they teach. A good teacher might deliver standardized quality to 90 students, while a bad teacher might deliver standardized quality to 5 students. The good teacher gets paid 18x as much as the bad teacher and the students all get standardized quality.<p>The main difficulty here is physical classroom dimensions.