A grung plugin that generates a valid SCORM IMS manifest file.
This plugin requires Grunt ~0.4.2
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-scorm-manifest --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-scorm-manifest');
Run this task with the grunt scorm_manifest
command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
Node Libraries Used: xmlbuilder-js (for xml generation).
In your project's Gruntfile, add a section named scorm_manifest
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
scorm_manifest: {
your_target: {
options: {
// Options go here
}
},
},
});
Type: String
Default value: '2004'
Possible values: 2004||1.2
This is used to define which version of SCORM will be applied to the manifest.
Type: String
Default value: 'CourseID'
This is used to define the top-level course ID.
Type: String
Default value: 'SCO Title'
This is used (by <organization />
) to define the title of the default organization. There will be only one organization.
Type: String
Default value: './'
This is used to define the path to which imsmanifest.xml
will be written.
Type: String
Default value: './'
Path to course files relative to imsmanifest file.
Type: Object
Default value: {}
Defines whether or not the course has a common section of resources shared by multiple scos.
Type: String
Default value: ``
The id of the common resource section.
Type: Array
Default value: []
A block of files that be inserted into the common resources section.
Example:
//sample configuration of common resources. It will include all files in the misc, scripts, styles, PDFs, and images
// folders, but will omit images in module-specific folders (e.g. images/Module1)
common:
{
id: 'commonResources',
files: [{
expand: true, // required
cwd: '<%= config.dist %>',
src: ['blank.html','misc/*.*','scripts/**.*','styles/**.*','PDFs/**.*','images/!(intro|splash|Module1|Module2|Module3|Module4)/**.*'], // file selector (this example includes subdirectories)
filter: 'isFile' // required
}]
}
Type: Array
Default value: []
An array of all the scos that will be defined. Each sco entry has the following properties:
Type: String
This is the id of the sco. It will be also used to create the sco's corresponding resource section. No spaces allowed.
Type: String
This is the title of the sco.
Type: String
This is the launch page for the sco (e.g. module1/index.html).
Type: Boolean
Default value: false
Whether or not the SCO makes use of common resources (e.g. style sheets, scripts, etc.).
Type: String
Default value: ``
Id of another sco that should be assigned as a prerequisite for the current SCO. Optional.
Type: Number
Default value: ``
Mastery score for the SCO. Optional.
Type: Array
Default value: []
Array of file blocks to be included w/in the SCO's resource section.
Sample SCO
{
id: 'sco_intro',
moduleTitle: 'Introduction',
launchPage: 'intro/splash.html',
includeCommonResources: true,
files: [{
expand: true, // required
cwd: '<%= config.dist %>',
src: ['intro/*.*','images/intro/*.*','images/splash/*.*'], // file selector (this example includes subdirectories)
filter: 'isFile' // required
}]
}
This example creates a SCORM 1.2 IMS manifest. The manifest will be written to the project directory and will include files in the project directory and all subdirectories.
// simple single SCO package
scorm_manifest: {
dist: {
options: {
version: '1.2',
courseId: 'partCD2015',
SCOtitle: '2015 Medicare Part C and Part D Reporting Requirements and Validation',
path: '<%= config.distScorm %>',
courseSubDir: '<%= config.courseSubDir %>',
scos: [
{
id: 'sco_intro',
moduleTitle: 'Introduction',
launchPage: 'intro/splash.html',
includeCommonResources: true,
files: [{
expand: true,
cwd: '<%= config.dist %>',
src: ['intro/*.*','images/intro/*.*','images/splash/*.*'], // file selector (this example includes subdirectories)
filter: 'isFile' // required
}]
},
{
id: 'sco_preAssessment',
moduleTitle: 'Pre-Assessment',
launchPage: 'PreAssessment/index.html',
prereqId: 'sco_intro',
includeCommonResources: true,
files: [{
expand: true,
cwd: '<%= config.dist %>',
src: ['PreAssessment/*.*'], // file selector (this example includes subdirectories)
filter: 'isFile' // required
}]
},
{
id: 'sco_lesson1',
moduleTitle: 'Module 1: Planning for Data Validation (DV) Activities',
launchPage: 'Module1/index.html',
prereqId: 'sco_preAssessment',
includeCommonResources: true,
files: [{
expand: true,
cwd: '<%= config.dist %>',
src: ['Module1/*.*','images/Module1/*.*'], // file selector (this example includes subdirectories)
filter: 'isFile' // required
}]
},
{
id: 'sco_lesson2',
moduleTitle: 'Module 2: Performing Data Validation (DV) Activities',
launchPage: 'Module2/index.html',
prereqId: 'sco_lesson1',
includeCommonResources: true,
files: [{
expand: true,
cwd: '<%= config.dist %>',
src: ['Module2/*.*','images/Module2/*.*'], // file selector (this example includes subdirectories)
filter: 'isFile' // required
}]
},
{
id: 'sco_lesson3',
moduleTitle: 'Module 3: Analyzing Results and Submission of Findings',
launchPage: 'Module3/index.html',
prereqId: 'sco_lesson2',
includeCommonResources: true,
files: [{
expand: true,
cwd: '<%= config.dist %>',
src: ['Module3/*.*','images/Module3/*.*'], // file selector (this example includes subdirectories)
filter: 'isFile' // required
}]
},
{
id: 'sco_lesson4',
moduleTitle: 'Module 4: Completing Post-Data Validation (DV) Activities',
launchPage: 'Module4/index.html',
prereqId: 'sco_lesson3',
includeCommonResources: true,
files: [{
expand: true,
cwd: '<%= config.dist %>',
src: ['Module4/*.*','images/Module4/*.*'], // file selector (this example includes subdirectories)
filter: 'isFile' // required
}]
},
{
id: 'sco_postAssessment',
moduleTitle: 'Post-Assessment',
launchPage: 'PostAssessment/index.html',
prereqId: 'sco_lesson4',
masteryScore: '70',
includeCommonResources: true,
files: [{
expand: true,
cwd: '<%= config.dist %>',
src: ['PostAssessment/*.*'], // file selector (this example includes subdirectories)
filter: 'isFile' // required
}]
}
],
common:
{
id: 'commonResources',
files: [{
expand: true,
cwd: '<%= config.dist %>',
src: ['blank.html','misc/*.*','scripts/**.*','styles/**.*','PDFs/**.*','images/!(intro|splash|Module1|Module2|Module3|Module4)/**.*'],
filter: 'isFile' // required
}]
}
}
}
},
- 2014-12-18 v0.2.0 Initial plugin release based on work by Ray Gesualdo (raygesualdo/grunt-scorm-manifest)