refactored quiz and study  js