Skip to content

Commit

Permalink
2020 update, 'nolms' event for alert, modal, toast
Browse files Browse the repository at this point in the history
  • Loading branch information
cybercussion committed May 20, 2020
1 parent 1ec13d8 commit e67239c
Show file tree
Hide file tree
Showing 12 changed files with 1,055 additions and 1,046 deletions.
6 changes: 3 additions & 3 deletions QUnit-Tests/js/scorm.bot.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion QUnit-Tests/js/scorm.bot.pack.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions QUnit-Tests/js/scorm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ This project was broke down originally to encompass an entire functioning SCO wi

These files are the main formatted source code for the SCOBot Content API. Per the documentation you can mix and match which files you use in your project. You may use them all, or include them in your own build processes.

##SCOBotUtil
## SCOBotUtil
This now includes an event system and other utilitiy methods used by the library. Since it was too difficult to expand this to more libraries without relying on these features, they are now baked in. No dependancies on jQuery or any other framework/library.

##SCOBotBase
## SCOBotBase
This is the bare minimum for establishing a connection to the lms, and providing the backwards compatibilty with both SCORM 1.2 and SCORM 2004. If you only use this file, your choosing to manage interacting with SCORM directly.

##SCOBot
## SCOBot
This automates the sequence doing typical load, initialize, checking mode, entry, suspend data and more. Creates friendly missing API's from the SCORM communication standard that makes setting objectives and interactions much easier. Baked in is a load, and unload event which will manage common tasks all SCO's must do. Also allows you to simply call happyEnding() to auto score your content. You can even take advantage of letting SCOBot score your objectives for you.

##SCOBot_API_1484_11
## SCOBot_API_1484_11
This is a local (simple) skeleton of the SCORM 2004 Runtime API. This mainly serves the purpose of allowing you to work offline and view console messages related to the communication standard of SCORM. Keep in mind this is only SCORM 2004's base API and does not include things like the Sequence and Navigation portion, or Shared State Persistence. It is NOT the actual Runtime API so it does not strictly enforce all portions of the student attempt.
2 changes: 1 addition & 1 deletion QUnit-Tests/js/scorm/SCOBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @event exception, load, unload, message, continue, comments_lms, resume
*
* @author Cybercussion Interactive, LLC <info@cybercussion.com>
* @license Copyright (c) 2009-2017, Cybercussion Interactive LLC
* @license Copyright (c) 2009-2020, Cybercussion Interactive LLC
* As of 3.0.0 this code is under a Creative Commons Attribution-ShareAlike 4.0 International License.
* @requires SCOBotBase, SCOBotUtil
* @version 4.1.6
Expand Down
16 changes: 12 additions & 4 deletions QUnit-Tests/js/scorm/SCOBotBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
* @event debug, getvalue, setvalue, exception, terminated, StoreData
*
* @author Cybercussion Interactive, LLC <info@cybercussion.com>
* @license Copyright (c) 2009-2017, Cybercussion Interactive LLC
* @license Copyright (c) 2009-2020, Cybercussion Interactive LLC
* As of 3.0.0 this code is under a Creative Commons Attribution-ShareAlike 4.0 International License.
* @version 4.1.6
* @version 4.1.7
* @param options {Object} override default values
* @constructor
*/
Expand All @@ -52,9 +52,9 @@ function SCOBotBase(options) {
// Please edit run time options or override them when you instantiate this object.
var Utl = SCOBotUtil,
defaults = {
version: "4.1.6",
version: "4.1.7",
createDate: "04/05/2011 08:56AM",
modifiedDate: "03/04/2016 12:24AM",
modifiedDate: "05/20/2020 08:18AM",
debug: false,
isActive: false,
throw_alerts: false,
Expand Down Expand Up @@ -1422,7 +1422,15 @@ function SCOBotBase(options) {
return true;
}
debug(settings.prefix + ": I was unable to locate an API for communication", 2);
// Need a gap in time here to allow events to be established, this is happening far before any listeners established.
setTimeout(function() {
Utl.triggerEvent(self, 'nolms', { msg: 'Could not locate Runtime API. Your data will not be persisted.'}); // Handle this or not at the SCO level
}, 1000);
if (settings.use_standalone) {
// Hint: You would use standalone mode if you intend on running this different than against a platform.
// If you were to run this on a platform, and not locate the LMS API due to Same-Origin-Policy or CORS the student would not know
// there instance was not persisted against the LMS. So this project will now fire up a alert below letting them know no connection
// was made.
// Create Local API in SCORM 2004
debug(settings.prefix + ": If you included Local_API_1484_11 I'll mimic the LMS. If not, all SCORM calls will fail.", 4);
settings.standalone = true;
Expand Down
2 changes: 1 addition & 1 deletion QUnit-Tests/js/scorm/SCOBotUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* https://github.com/cybercussion/SCOBot
*
* @author Cybercussion Interactive, LLC <info@cybercussion.com>
* @license Copyright (c) 2009-2016, Cybercussion Interactive LLC
* @license Copyright (c) 2009-2020, Cybercussion Interactive LLC
* As of 3.0.0 this code is under a Creative Commons Attribution-ShareAlike 4.0 International License.
* @version 4.0.5
* @constructor
Expand Down
2 changes: 1 addition & 1 deletion QUnit-Tests/js/scorm/SCOBot_API_1484_11.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @event StoreData
*
* @author Cybercussion Interactive, LLC <info@cybercussion.com>
* @license Copyright (c) 2009-2017, Cybercussion Interactive LLC
* @license Copyright (c) 2009-2020, Cybercussion Interactive LLC
* As of 3.0.0 this code is under a Creative Commons Attribution-ShareAlike 4.0 International License.
* @requires SCOBotUtil, SCOBotBase
* @version 4.1.6
Expand Down
8 changes: 6 additions & 2 deletions QUnit-Tests/js/test/scobot.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var desiredTimeType = "UTC"; // This gets changed based on tests which can goof
$ = SCOBotUtil,
scorm = new SCOBotBase({
debug: true, // edit
throw_alerts: false, // edit
throw_alerts: true, // edit
time_type: 'UTC', // edit
exit_type: 'suspend', // edit
success_status: 'unknown' // edit
Expand All @@ -35,7 +35,11 @@ var desiredTimeType = "UTC"; // This gets changed based on tests which can goof
getvalue_calls = 0,
// These things tend to happen during authoring/creation. We'll use this later to put into suspend data
character_str = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ˜‌‍‎‏–—―‗‘’‚‛“”„†‡•…‰′″‹›‼‾⁄₣₤₧₪₫€℅ℓ№™Ω℮⅓⅔⅛⅜⅝⅞←↑→↓∂√∞∩∫≠≡■□▲△▼○●♀♂♪";

$.addEvent(scorm, "nolms", function (e) {
"use strict";
alert(e.msg);
SB.debug(e.msg, 1);
});
$.addEvent(scorm, "setvalue", function (e) {
"use strict";
setvalue_calls += 1;
Expand Down
Loading

0 comments on commit e67239c

Please sign in to comment.