adapt-authoring-adaptframework 1.9.5 → 1.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AdaptFrameworkImport.js +10 -2
- package/package.json +1 -1
|
@@ -426,6 +426,7 @@ class AdaptFrameworkImport {
|
|
|
426
426
|
FWUtils.log('debug', 'found plugin', name)
|
|
427
427
|
this.usedContentPlugins[path.basename(p)] = { name, path: p, version, targetAttribute, type: getPluginType(bowerJson) }
|
|
428
428
|
}))
|
|
429
|
+
this.contentJson.config._enabledPlugins = Object.keys(this.usedContentPlugins)
|
|
429
430
|
}
|
|
430
431
|
|
|
431
432
|
/**
|
|
@@ -445,7 +446,15 @@ class AdaptFrameworkImport {
|
|
|
445
446
|
* @return {Promise}
|
|
446
447
|
*/
|
|
447
448
|
async loadContentFile (filePath) {
|
|
448
|
-
|
|
449
|
+
let contents
|
|
450
|
+
try {
|
|
451
|
+
contents = await FWUtils.readJson(filePath)
|
|
452
|
+
} catch (e) {
|
|
453
|
+
if (e.constructor.name === 'SyntaxError') {
|
|
454
|
+
throw App.instance.errors.FILE_SYNTAX_ERROR.setData({ path: filePath.replace(this.path, ''), message: e.message })
|
|
455
|
+
}
|
|
456
|
+
throw e
|
|
457
|
+
}
|
|
449
458
|
if (contents._type === 'course') {
|
|
450
459
|
this.contentJson.course = contents
|
|
451
460
|
return
|
|
@@ -454,7 +463,6 @@ class AdaptFrameworkImport {
|
|
|
454
463
|
this.contentJson.config = {
|
|
455
464
|
_id: 'config',
|
|
456
465
|
_type: 'config',
|
|
457
|
-
_enabledPlugins: Object.keys(this.usedContentPlugins),
|
|
458
466
|
...contents
|
|
459
467
|
}
|
|
460
468
|
return
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adapt-authoring-adaptframework",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.7",
|
|
4
4
|
"description": "Adapt framework integration for the Adapt authoring tool",
|
|
5
5
|
"homepage": "https://github.com/adapt-security/adapt-authoring-adaptframework",
|
|
6
6
|
"license": "GPL-3.0",
|