I would like to generate a list based on selections made by students

I have several students who have selected the classes in which they want to participate in the first page. On the second page, I would like to generate a list for each class with the names of the students in that class based on their selections. Is there any way to do this?

enter the description of the image here