diff --git a/js/adapt-contrib-spoor.js b/js/adapt-contrib-spoor.js index a48c0690..6fb3a0af 100644 --- a/js/adapt-contrib-spoor.js +++ b/js/adapt-contrib-spoor.js @@ -4,6 +4,7 @@ import StatefulSession from './adapt-stateful-session'; import OfflineStorage from './adapt-offlineStorage-scorm'; import offlineStorage from 'core/js/offlineStorage'; import { shouldStart as shouldStartCookieLMS, start as startCookieLMS } from './scorm/cookieLMS'; +import './../libraries/jquery.keycombo'; class Spoor extends Backbone.Controller { @@ -27,12 +28,10 @@ class Spoor extends Backbone.Controller { // of the course data loads offlineStorage.get(); offlineStorage.setReadyStatus(); + // setup debug window keyboard shortcut - require(['libraries/jquery.keycombo'], () => { - // listen for user holding 'd', 'e', 'v' keys together - $.onKeyCombo([68, 69, 86], () => { - Adapt.spoor.scorm.showDebugWindow(); - }); + $.onKeyCombo([68, 69, 86], () => { + Adapt.spoor.scorm.showDebugWindow(); }); } diff --git a/js/scorm/wrapper.js b/js/scorm/wrapper.js index f0648326..843317f2 100644 --- a/js/scorm/wrapper.js +++ b/js/scorm/wrapper.js @@ -584,6 +584,8 @@ class ScormWrapper { if (error.data.value === '') error.data.value = '\'\''; } + if (!Adapt.course) return; + const config = Adapt.course.get('_spoor'); const messages = Object.assign({}, ScormError.defaultMessages, config && config._messages); const message = Handlebars.compile(messages[error.name])(error.data);