refactored quiz item validation