Well, here can students who got different grades go to the same classes as well.
In elementary school everything was basic so there were just grades and if you couldn't handle the grade you are on you restart it next year instead of progressing.
In the later steps of school there are individual classes for everything, there are core classes most go to and some which are more individual ones. Some do go to the same classes as other higher grades but it is highely unlikely since their studies are on a completely different level of difficulty and requires alot more understanding.