Skip to content

Configure your project with config.json

Chuck Lorenz edited this page Mar 14, 2016 · 20 revisions

config.json

config.json is located at /src/course/config.json. This required file is included with the installation of the Adapt framework and the Adapt authoring tool.

Note: What's the difference between config.json and course.json?

  • config.json contains settings that determine how your Adapt project functions. Whereas course.json is focused on content that is used throughout your course, oftentimes being reused by various components and other plug-ins.
  • config.json resides outside of the language folder and course.json resides inside (e.g., /src/course/en). Settings that are language dependent go in course.json.

Settings Overview

The properties listed below and their values are used to configure an Adapt project. Reference config.json on GitHub to see them properly formatted as JSON. Configuring General Settings provides information about how they appear in the authoring tool.

Attributes

_defaultLanguage (string): This value represents the primary language in which course content will appear. A subfolder of /course is created using this value (e.g., /course/en). Its value is assigned to the "lang" attribute of the HTML tag (e.g., <html lang='en'>). It is recommended to choose values from the IANA language tag registry.

_defaultDirection (string): This value is used to set the base direction of text for display. Adapt's default direction is left-to-right (ltr). To enable HTML for such right-to-left scripts as Arabic and Hebrew, use the value rtl. This will add the 'dir-rtl' class to the html tag. (No similar class is added for ltr.)

screenSize (object): The screen size group allows pixel widths to be assigned to three device widths: small, medium, and large. Values assigned must be numbers only; include no measurement unit. Note: The screen sizes set the Adapt.device.width that is used within the application code. They are not referenced by the CSS theme for media queries. Set screen sizes for CSS media queries in theme.json located in the theme folder.

_questionWeight (number): This value is used by Question components when using the function setScore(). This value functions as a global default for all Question components; but individual components may override it by including the same attribute in its JSON model. Reference the Matching component's example.json as an example.

_accessibility (object): Adapt's built-in accessibility feature provides tab-highlighting, enables aria-labels that are otherwise hidden, and processes content text to ensure screen readers can access it. The accessibility attributes group contains values for _isEnabled, _shouldSupportLegacyBrowsers, and _isTextProcessorEnabled.

_isEnabled (boolean): Specify a value of true or false to enable or to disable the accessibility feature.

_shouldSupportLegacyBrowsers (boolean): If set to true, Adapt will supply the 'focused' class to accommodate some legacy browser's inability to recognize :focus. The 'focused' class is used to outline elements when tab-highlighting is enabled.

_isTextProcessorEnabled (boolean): If set to true, content text is processed by the a11y_text function of jquery.a11y.js. The primary goal is to ensure the text or HTML is accessible by tabbing.

_drawer (object): Adapt's Drawer provides a slide out panel that is often used to display indicators of page level progress and links to ancillary course resources. The Drawer uses the velocity.js engine for its animations. The Drawer attributes group contains values for _showEasing, _hideEasing, and _duration.

_showEasing (string): This value controls the variations in speed and bounce as the Drawer opens. It must be a value acceptable to Velocity. Most of jQueryUI's easings are built into Velocity.

_hideEasing (string): This value controls the variations in speed and bounce as the Drawer closes. It must be a value acceptable to Velocity. Most of jQueryUI's easings are built into Velocity.

_duration (number): Specifies the number of milliseconds it will take for the Drawer to open or close.

_spoor (object): Adapt's Spoor extension provides course tracking functionality. Its attributes are detailed in its README.

_disableAnimationFor (string array): A comma separated list of jQuery selectors that could match on the HTML tag. A match allows core modules and other plug-ins to employ alternative styles for those browsers that do not support common animation techniques. Typical strings include ".ie8" (index.html), and ".iPhone.version-7\\.0" (src/core/js/device.js).

build (object): By default, Adapt includes all installed plug-ins in its build process. (The result of the build is found at build/adapt/.) Sometimes the developer may install plug-ins that are only used during development or that are not yet being used by the content. This bloats the build needlessly. The build object allows the developer to specify explicitly which plug-ins will be included in the build or excluded from the build. The build attributes group is optional. It contains values for one of two arrays: excludes or includes.

excludes (string array): All plug-ins will be included in the build except those whose names appear in this comma separated list.

includes (string array): Only the plug-ins whose names appear in this comma separated list will be included in the build.

Example:

"build": {
    "excludes": [
        "adapt-inspector",
        "adapt-contrib-assessmentResultsTotal"
    ]
} 
Clone this wiki locally