I don't think primary or secondary school should be voluntary, but I think it should also be tailored to the needs of the student. I can understand teaching a student the basic core subjects -- science, math, history, PE/health, language arts -- through the middle/junior high school level, or even through the sophomore year of high school, but after that, I feel like it should be tailored more towards a student's interests. I can say that after my junior year of high school, I only needed two courses to graduate: English and government; everything else was optional because I had already met the credit requirements, so I was able to take other courses that sounded interesting and enjoy my senior year.
Unfortunately, I was also recommended and more or less forced to take other courses I wasn't really interested in. At the time, I was interested in going into graphic design, so I was recommended to take a class in desktop publishing, so I took that and keyboarding, which was the prerequisite to desktop publishing. I was okay with that because it at least put me down the right path (and I now have some sort of experience with it now). I went into AP Psychology because the teacher was pretty cool (ended up being an awful class though because the teacher ended up hating my class) and Spanish 5 also because I enjoyed the teacher and I had also been playing with the idea of going into foreign relations. (Ironically, now I'm a journalism major. xD) The one course I wish I didn't have to take but was more or less forced into taking was a "math" course in computer programming. (I put math in quotes because it wasn't really a math course at all; it was basically a class in Alice and a little bit of Java at the end, super simple course, easy A. My school counted it as a math class though.) I had finished my math requirements in my junior year and was happy to be done with math because I loathed the subject and started to do poorly in it after 5th grade. My counselor strongly recommended and more or less made me reluctantly agree to take the computer programming class as an extra "math" course so that I would look better to colleges. Of course, I ended up getting rejected from my first and only choice university, went to community college, and now I'm at the same school that rejected me as a senior in high school.
So yeah, I really think the high school courses should be more tailored to the student. If a student's interested in computer programming, let them take courses in that. If they want to go into foreign relations, let them take those courses. I don't like the idea of a student being forced to take meaningless math courses that they're going to do nothing with after a certain point in their lives. The student isn't remotely interested in it, and the teacher is forced to deal with an uninterested student and the student has to force themselves to be interested to pass the class.