A simple validator and parser for SCO zip files written in node
var params = {
pathToScoZip: 'fixtures/unpackScoZipTests/articulate_sco_with_quiz.zip',
pathToExtractZip: 'fixtures/unpackScoZipTests/extractFolder'
}
// initialize the parser
var scoParser = require('sco-parser')(params);
scoParser.validate(function(err, result)) {
scoParser.parse(function(err, scoInfo)) {
console.log(scoInfo.scoHtmlHref); // entry point to the sco
console.log(scoInfo.quizCount); // value is 1 if a quiz exists in the sco
scoParser.destroy(function(err) {});
});
});
We created a command line utility for quickly validating scorm files. It can be used as follows:
npm run verify queryObject.path fixtures/unpackScoZipTests/articulate_sco_with_quiz.zip
Initialize the parser.
pathToScoZip
- location to find the scorm package (zip file)
pathToExtractZip
- location to unpack the scorm package to
validate
- validates that a scorm package (.zip) contains an imsmanifest.xml
parse
- returns basic information about the scorm package
scoHtmlHref // filename which is the entry point to the sco
quizCount // number of quizzes found in the sco
destroy
- cleans up temp files
MIT