cybercussion / scobot Goto Github PK
View Code? Open in Web Editor NEWSCORM API for Content. JavaScript library, QUnit tests and examples.
Home Page: https://cybercussion.com
SCORM API for Content. JavaScript library, QUnit tests and examples.
Home Page: https://cybercussion.com
Hi,
I'm trying to consume scorm / AICC complaint course from my web application. Are there any standard players that can do this?
I am using the scobot js for initializing and launching scorm based course. I am having the following issue when I try to get suspended data.
when the course is launched very first time the suspended data is null and as soon as the course started I save the suspended data using js and it is successfully saved. The issue occurs when I don't close the course window and just refresh it with CTRL+F5. Then I get suspended data null in the following method
SCOBotUtil.addEvent(SB, 'load', function (e) { // in 4.x.x
// SCOBot already took care of connection to the LMS and Initialize!
// Do everything else you would do to fire up or resume your content here.
var suspendData = getLMSValue("cmi.suspend_data");
console.log(`From Scobot Js = ${suspendData}`);
return false;
});
But when I again refresh the page using CTRL+F5 it works fine. Also, after launching the course very first time and then I close the window and start the course again it works fine.
my question is why I am getting suspended data null after launching course very first time and then do a hard refresh without closing the course window? It should give me suspended data
I'm having trouble getting the LMS to move on to the next SCO after calling
scorm.setvalue('adl.nav.request', 'continue');
I copied the ScoBot.finish() function and came up with this:
/**
* Next
* This will move to the next sco in the sequence.
* @returns {String} 'true' or 'false'
*/
this.next = function ()
{
if (isStarted)
{
scorm.debug(settings.prefix + ": I am moving next...", 3);
scorm.setvalue('adl.nav.request', 'continue');
updateStatus();
scorm.commit();
}
return notStartedYet();
};
But whenever I call my ScoBot.next() function, the SCO page does not move on to the next one in the manifest.
I've tried calling
scorm.set('success_status', 'passed');
to work with updateStatus() but I'm still getting no dice.
It appears to me that SCORM_API is set up to create standalone SCOs, not a squence of SCOs in a single content package, so maybe I'm trying to do something that's not intended... =/
Any direction on this issue would most appreciated.
Thank you.
Hi,
I'm able to run a SCORM 2004 (4th edition) using the SCOBot but the cmi object is never updated.
After interacting with the course I'm expecting to have some data saved into the cmi (session_time, suspend_data, interactions, ...) but it is always at the initial state.
Below my code
<script type="text/javascript" src="./js/SCOBotUtil.js"></script>
<script type="text/javascript" src="./js/SCOBot_API_1484_11.js"></script>
<script type="text/javascript" src="./js/SCOBotBase.js"></script>
<script type="text/javascript" src="./js/SCOBot.js"></script>
<script type="text/javascript">
var scorm = new SCOBotBase({
debug: true,
exit_type: 'suspend',
success_status: 'passed',
}),
SB = new SCOBot({
happyEnding: true
});
Thank you
"use strict";
causes a 301 error in Pegasus when using Chrome.
Error Code: 301
Error Message: General Get Failure
Diagnostic: Exception occured in GetValue
I snooped around and looked at the source code for the window.API_1484_11
object that Pegasus uses. This is the snippet for the GetValue()
method:
function RetrieveValue(strDataElementName)
{
try
{
if (arguments.callee.caller!=null&&arguments.callee.caller.caller!=null)
{
// snipped
}
}
catch(ex)
{
return SetErrorState(strEmpty,"301","Exception occured in GetValue")
}
}
What happens is arguments.callee.caller
raises an Uncaught TypeError: Illegal access to a strict mode caller function.
exception in Chrome. Pegasus is trying to call the caller function but since that function is in strict mode it raises an exception. The catch catches the exception and returns the 301 error code.
The recommended solution would be to remove the "use strict";
declaration so that the Scorm API is compatible with different LMS environments. I understand you want to be jslint compliant but that compliance hinders compatibility.
Hi,
Is this a SCORM player capable of parsing the imsmanifest.xml file and serving the content with sequencing?
I went through most of the documentation but couldn't really find a way to parse a SCORM content package.
Thanks,
Thihara
Hi,
I am a product owner at leapest.com, and we are evaluating SCObot. We are currently using the scormpool player to serve scorm packages without an LMS. Is it possible to use SCObot in conjunction with scormpool to get and set cmi
object data across instances? Please let us know if you are available for detailed discussions?
Best regards,
Harry
Hi,
first of all, thank you for providing the SCOBot open-source, it's really a big helper.
I am using the SCOBot#setInteraction method to record question answers. I have a case in my project where I want to update only the timestamp(the time when the user starts working actively on the interaction). In the wiki section it is stated that one could send only the items that have updated(another great feature).
Unfortunately, I get error messages stating that I have not set some items. I was assuming that the SCOBot would just write the timestamp in the existing interaction. Do I misunderstand what you have written in the wiki?
Thank you very much in advance for your time.
Hi,
We're experiencing a problem with the completion status when leaving an SCO.
Our SCO is made of a web page where we add an exit button. When we use this button to leave the course, the "happy ending" is well sent to the LMS (with success as "passed", status as "completed" and score as "100%"), but if we leave the course by closing the window, only the "passed" is correctly returned, while the status is set as "incomplete" and score as "unknown".
Here is the custom integration we're using:
<script type="text/javascript">
var scorm = new SCOBotBase({
debug: true,
exit_type: 'finish',
success_status: 'passed',
completion_status: 'completed'
});
var SB = new SCOBot({
happyEnding: true,
initiate_timer: false,
scorm_strict: true,
base64: false,
useJSONSuspendData: false,
doNotStatusUntilFinish: false,
sequencing: {
nav: {
request: 'exitAll'
}
}
});
SCOBotUtil.addEvent(SB, 'load', function(e) {
player = new SCOPlayer();
SB.happyEnding();
SB.commit();
return false;
});
SCOBotUtil.addEvent(SB, 'unload', function(e) {
player.exit();
scorm.setvalue('adl.nav.request', 'exitAll');
SB.happyEnding();
SB.finish();
return false;
});
(function () {
var doneBtns = document.getElementsByClassName('lms-finish'),
printBtns = document.getElementsByClassName('do-print');
var i;
for (i in doneBtns) {
doneBtns[i].onclick = function () {
scorm.setvalue('adl.nav.request', 'exitAll');
SB.happyEnding();
SB.finish();
};
}
for (i in printBtns) {
printBtns[i].onclick = function () {
window.print();
};
}
})();
</script>
We've set the nav.request value to exitAll because we have only one SCO per course, and using any other value caused some LMS to relaunch the same SCO when close it via the custom exit button.
I've tried forcing the datas to be commited on launch, but it does not seem to work either.
Any idea of what could be wrong here?
Thanks for your help!
Expected:
"Tue Mar 20 2012 10:47:54 GMT-0700 (PDT)"
Result:
"Tue Mar 20 2012 11:31:06 GMT-0500 (Central Standard Time)"
I'm in the central time zone. Are the tests hardcoded to pacific?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.