Yes, but only till Secondary school is finished. After that, they should provide the students with autonomy to be able to choose the subjects they need.
How can one pass without having to learn what the teacher has taught in a certain lesson.
Not ALL lessons. Some lessons should be mandatory - the basics (math, english, language). But if all lessons are mandatory, it will mean it will be MANDATORY for students to take music, physed, visual art, drama, dance, computer programming, religion, and many other courses not all students will want to take, and of course parents will not be happy with that. It also increases the workload by a lot for each student.