Twenty Question Quiz
Test your general knowledge against this multiple-choice quiz of 20 questions
Select an answer and press Next
Sound on

This JavaScript program utilises the Model View Control (MVC) design pattern.

At startup, an instance of each of these classes is initialised, ready to interact with each other.

At this point and under instructions from Control, Model loads the question and answer data in the form of XML from the back-end and then parses it out into various arrays.

When this process is complete, Model then notifies the Controller, which then requests the first question and set of multiple choice answers from Model and then tells the Viewer to display the relevant data in the user interface.

The program continues like this until all questions have been answered, at which point the Controller summarises a user's score and tells the Viewer to display the results in the UI.

The program provides a running visual indication of correct and incorrect answers and right/wrong sounds can be toggled.

Julian Ward-Davies BA Hons 2018. Designed and programmed by the author.