Migrated logic for play_loop to quizzer.py