O'Reilly logo

Better Backbone Applications with MarionetteJS by Joseph Zimmerman, Smashing Magazine

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 17: Taking and Reviewing Quizzes

In this final chapter, we’ll finish up our Quiz Engine application by implementing the Quiz module, which handles both taking and reviewing quizzes, depending on the state of the quiz.

Once again we’ll start by looking at the index.js file for the module, which will be in a new folder called Quiz inside the modules folder.

js/modules/Quiz/index.js

QuizEngine.module('Quiz', function(Quiz) {
    // Quiz Module Must be Manually Started
    Quiz.startWithParent = false;

    // Router needs to be created immediately, regardless of whether or not the module is started
    Quiz.controller = new Quiz.Controller();
    Quiz.router = new Quiz.Router({controller: Quiz.controller});

    Quiz.addInitializer(function(){
        Quiz.controller.show ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required