-
Notifications
You must be signed in to change notification settings - Fork 0
How to Lock Menu Items
A course presents a number of menu items to the learner. Of this number, only the first is enabled. After the learner completes the first, the other menu items (or some subset) are enabled and the learner now has access to them.
- Ensure your Adapt framework version is ^2.0.9
- Ensure the menu includes code snippet, but implement the menu json normally per the example.json or README.
- Add your "_lockType" to course.json
- Style CSS and/or adjust JavaScript based on class locked.
json
In course.json add the following:
,"_lockType": "sequential"
effect
The first menu item will be enabled. The following items will be disabled. Each item will be enabled when the preceding item is completed.
json
In course.json add the following:
,"_lockType": "unlockFirst"
effect
The first menu item will be enabled. The following items will be disabled. When the first item is completed, all subsequent items will be enabled.
json
In course.json add the following:
,"_lockType": "lockLast"
effect
The all menu items are enabled except the last item. The last item is enabled only when all other menu items have been completed.
json
In course.json add the following:
,"_lockType": "custom"
In contentsObjects.json add the following to the page or menu that you want locked:
,"_lockedBy": "co-XX"
where "co-XX"
is the Id of the object whose completion will enable this page or menu.
effect
The all menu items are enabled except any item whose json contains the "_lockedBy"
attribute. That item will be enabled only when the menu item specified by the value of "_lockedBy"
is completed.
CSS _isComplete _force
define completion define enabled
src/core/js/models/adaptModel.js
Matt: please note that I have instructed that all lockTypes including custom to be assigned in course.json, and that custom requires an additional assignment of _lockedBy
in contentObjects.json.
Complete page: Developers Guide: Menu. How to ensure the menu can be locked.
- Framework in Five Minutes
- Setting up Your Development Environment
- Manual Installation of the Adapt Framework
- Adapt Command Line Interface
- Common Issues
- Adapt API
- Adapt Command Line Interface
- Core Events
- Core Model Attributes
- Core Modules
- Peer Code Review