Exam Development

Adding Other Packages

Though the exam seed contains everything you need to get started, it may not contain all the packages you need to build your exam. Additional package are available from the Hammer team and other contributors. For example, if you are building an exam for the Certiport LMS, you will need to install the hammer-lms package.

Packages are registered and retrieved using bower. Hammer has its own private bower registry. In fact, you can see the packages registered are listed in the document's home page.

The syntax for adding a package is:

bower install <PACKAGE NAME> --save-dev

You will see on the home page under Packages the bower command is listed.

Bower install example

Run the command from your project root. It will install the package and update the bower.json file with the addition.

Registering a package in config.js

In addition to installing the package you also need to register it, otherwise it will not be loaded into your exam. You register a package by

Important: hammer-application MUST be the first package to load. NEVER include your package above hammer-application.

Removing a package

It should be noted that if you no longer need a package or accidentally installed a package you can uninstall it by using bower uninstall

bower uninstall <PACKAGE NAME> --save-dev

timer Exercise: Install hammer-lms package

In this exercise you will install and register the hammer-lms package with your exam.

From your project root, run the following command:

bower install hammer-lms --save-dev

Open sandbox/config.json and add the following line to the packages section:

{ "name": "hammer-lms"},

Your packages will now look like this:

"packages": [
    { "name": "hammer-application"},
    { "name": "hammer-lms"},
    { "name": "hammer-accessibility"},
    ...
]