Refactore the code to get student's problems in a course