refactored edit_quiz.js for readability