Skip to content

Compiling, testing and deploying your Adapt course

Chuck Lorenz edited this page Sep 8, 2016 · 4 revisions

To make developing and deploying Adapt courses as painless as possible, we use the Grunt task runner to automate as many of the menial tasks as possible.

Tasks

After navigating to the root directory of your Adapt course (you know you're in the right place if you have a Gruntfile.js), you can run any of the grunt tasks by typing grunt followed by the task name:
For example,
grunt build

Below is a list of the available tasks. (For brevity, the grunt portion has been left out.)

Task name           Description
help Lists out all available tasks along with descriptions. Useful to quickly look up what's available without having to leave the command line.
Tip: Simply running grunt will have the same effect.
build Compiles all files in src to create a production-ready minified/compressed version of your course.
Extra info: Each time you run build, grunt does the following: checks the JSON for errors, copies all assets, compiles the Less, compiles the handlebars templates, generates dynamic configuration options ( config.json and course.json ), inserts any missing tracking IDs, and finally compiles the js. This explains why it can take a while sometimes!
dev The same as build, with a few notable developer-friendly differences:
  • Includes source maps for both the Javascript and Less.
  • Runs the watch task, which monitors your source code for any file changes and runs the appropriate grunt tasks to automatically update your build.
check-json Validates the course JSON, checks for duplicate IDs, and checks that each element has a parent.
Note: This task runs during the build and dev tasks, so there is usually no need to run it manually.
tracking-insert Adds tracking identifiers to the relevant places in your JSON files. This task only fills in any missing IDs (any existing IDs are left), which can result in non-sequential numbering. If this bothers you, you can use tracking-reset.
Note: This task runs during the build and dev tasks, so there is usually no need to run it manually.
tracking-remove Removes all tracking IDs from your JSON files. Use this if you aren't using a tracking plug-in such as adapt-contrib-spoor.
Note: Leaving the IDs in has no detrimental effect.
tracking-reset Resets all tracking IDs in your JSON files starting from 0.
server Runs a local server on your machine and opens a browser window ready for you to test your course locally. Check the console output for the URL.
server-scorm Same as above but provides a dummy SCORM interface to allow you to test the tracking of your course.
translate:export Exports translatable text from the master course.
translate:import Imports translated text files and creates a new language version of the course.

Creating the SCORM package

Once you have built your course using build or dev, you are ready to upload it to a web server or LMS. To do this, you simply need to copy the files found in /build according to the instructions for your specific platform.

Clone this wiki locally