JS MVC design pattern quiz

Overview

Adaptable quiz in JavaScript

date

February 2016

tools used

HTML, SCSS & jQuery

How

Using the MVC design pattern to separate concerns within the code. For example keeping quiz questions within the questionData module. UI interaction within a UIController module, and accesing both using a controller module. This is my first attempt using MVC and i am beginning to see the pros, especially for data that would need to be kept private, the mvc pattern offers a way of deciding whether you would like certain code to be private or public. It makes use of object literals and creates an easy way to access code. An awesome post explains this in technical detail here.

Learnt

MVC pattern basics. Multi dimensional arrays. For loop to check radio checked. css progression bar. Accessing arrays. Ipdating the dom. Calling functions.

See the Pen Module pattern quiz by Harry Beckwith (@fun) on CodePen.

← Back to all projects