created quiz logic