avoid repeated courses for student and teachers