Grading is not dissimilar to setting up arbitrary metrics on a business or an engineering team.
People will find ways to optimise for the metric.
If you give bonuses based on number of commits created or number of tickets closed you'll end up with a lot of useless commits and tickets.
If the only thing that matters in order to pass a course is to do an exam, people will optimise for that. If someone doesn't like the subject or doesn't like the teacher or doesn't like being taught (especially disagreeable boys), they will happily skip the subject and just try to get a passing score.
In university I was already working as a professional developer and I attended only a few classes I cared about and hacked my way out of exams with a mix of cheating and cramming the night before.
I enjoyed all the project work instead and I excelled at that. But that was worth just 1-2 points out of 30. Why was I forced to memorise bullshit I didn't need and that I would have not remembered 3 seconds after the exams in order to get a piece of paper saying I graduated? Isn't being able to do the projects more important than that?
When I hired people with degrees from "good schools" I was always surprised to realise how little were they able to get done on their own. I quickly stopped even checking their qualifications as they're completely worthless for anything related to work.
If I had to reform education I would make it totally based on projects. There would be no grades or titles when you get a job, just an increasingly longer list of projects you worked on.
When I was in school I had to take a Latin class. I didn't want to take it but I picked the best course according to my interest - and unfortunately it had Latin.
I spent those lessons secretly working on my own projects, then I downloaded a bunch of famous texts with their translation and I just wrote a J2ME application to look things up and used it for 5 years (Mobile internet was very expensive back then and searching on the internet would have been way harder).
After I finished my written finals in all the subjects, luckily my score was already high enough not too pass, even if I got zero at the oral exam and I kind of bullshitted my way through that last exam.
Was there any point in trying to force me to learn something? Why do we put people in this situation?