refactor javascript answer statement dynamically shows answered via ajax