-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscorm.js
More file actions
27 lines (27 loc) · 891 Bytes
/
scorm.js
File metadata and controls
27 lines (27 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* izy-loadobject nodejs-require */
const scoParserGenerator = require('./index.js');
const { execSync } = require('child_process');
module.exports = (function() {
const scormModule = () => {};
scormModule.verify = queryObject => {
const { path } = queryObject;
const pathToExtractZip = '/tmp/scormtool';
execSync(`rm -rf ${pathToExtractZip}`);
var params = {
pathToScoZip: path,
pathToExtractZip
};
var scoParser = scoParserGenerator(params);
scoParser.validate(function(err, result) {
if (err) {
console.log({ err, result });
return ;
}
scoParser.parse(function(err, scoInfo) {
console.log(scoInfo);
scoParser.destroy(function(err) {});
});
});
}
return scormModule;
})();