i only know about primary school classes since i moved before secondary school, but it's based on rankings. you get letter grades for classes, and then the total score (it's like gpa) determines your rank in the whole grade. it's then split into A, B, C, D, E, classes depending on those grades/rankings. on report cards or w/e you get letter grade on each subject, as well as a rank in your class and the whole grade level. i think this is similar in secondary/high school as well. and unlike in the u.s. where you switch classes based on choices, so that you have different classmates, you stay in the same classroom and teachers are the ones who switch around. that's one thing i really liked, it's that you're with pretty much the same people in your school years if you keep up grades, so there is a stronger bond between classmates.