adding quiz logic via javascript