Question

Following is the working code, which is not throwing any error but I would like to send data from the player playing SCORM package to LMS using jQuery.

Code -

<html>
<head>
    <title>SCORM Player - <?php echo $_GET['name'] ?></title>
    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script>
        $(document).ready(function(){

        })
    </script>
</head>

<frameset frameborder="0" framespacing="0" border="0" rows="0,*" cols="*">
    <frame src="SCORM_2004_APIWrapper.js" name="API_1484_11" noresize>
    <frame src="course/ThomasJefferson_sco2004/index.html" name="course" id="couse">
</frameset>
</html>

In between ready() I tried these codes but unable to crack :(

    $(document).ready(function(){
        var stat = API_1484_11.GetValue("cmi.location");
        // tried with objAPI as show here http://scorm.com/scorm-explained/technical-scorm/scorm-2004-overview-for-developers/
        console.log(stat);
    })

My Folder structure-

-index.php
-player.php
-course/SCORM-course (directory)
-wrap.js
-SCORM_2004_APIWrapper.js

All code -

My index.php code - http://pastebin.com/e8fcvxep

My Player.php code - http://pastebin.com/R0zRaVXJ

My wrap.js code - http://pastebin.com/Lte4eTKu

My SCORM_2004_APIWrapper.js code - http://pastebin.com/kdQ0JR04

Let me know how could I handle the transferring of data from player to the LMS.

Was it helpful?

Solution

The SCORM_2004_APIWrapper.js you reference is actually for the content or SCO to locate the SCORM 2004 Runtime provided by the LMS. This is called a "API_1484_11". The API Wrapper itself searches the Document Object Model (DOM) for the API_1484_11. SCO's are typically loaded into IFRAME, Popups or new Windows/Tabs. So they search their parent window for this API. Keep in mind the SCORM 2004 Run-Time Environment PDF from Advanced Distributed Learning goes into these protocols and "rules". An example in my own project would be a light weight "Local_API_1484_11.js". I set this up to mimic the LMS in a local test of the SCO so you don't have as many round trips testing. You could use that as a baseline for a real one, but keep in mind there are many rules all based on the white paper, and this is far from all the error code support.

I don't know of anyone thats released a free version of this since it has strings attached to a server implementation which reads the SCORM CAM Packages (imsmanifest.xml). Passes information along like time limits, launch parameters, completion thresholds etc … You commonly manage all these parameters, assignments, student profiles, then bolt on reports, forums etc...

I have more information on GitHub about the SCO / LMS relationship on my Github project. http://cybercussion.github.io/SCOBot/

If you're working in a non-profit capacity I have a more enhanced LMS Runtime project in beta. Just send me a message.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top