you would need to use a formula to place them all on one line. shared variables, set them for each class. If the classes are dynamic, and not from a list, you might want to run dual shared arrays, one with the name of the course and one with the grade, might be a challenge to display.
regardless, you are going to need a formula and display the results in a group footer. If you are going to do aggregate totals on the grades, you will need more variables as they will be needed to keep track of the values.
HTH