Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 1.26 KB

README.md

File metadata and controls

50 lines (30 loc) · 1.26 KB

sco-parser

A simple validator and parser for SCO zip files written in node

Usage

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

Params

Initialize the parser.

pathToScoZip - location to find the scorm package (zip file)

pathToExtractZip - location to unpack the scorm package to

Methods

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

License

MIT