Added checks for previous quizzes taken and related helper functions