It extremely easy to make it a meritocracy: just impose an externally-graded exam at the end. Then, the students cannot cheat (because it won't be their teachers grading them), and the teachers don't have an incentive to cheat (because high grades with low final exam will reveal their fraud).