by Daniel Wolff.
I agree that having separate "courses" seems like the easiest solution. If you want to have teachers only see their own students you can modify the teacher permissions or clone the teacher role and modify the following permission:
Access all groups
The gradebook view unfortunately still allows teachers to see all students (I think).