Search code examples
apiscorm

SCORM 1.2 API Examples/Tutorials


I have spent a considerable amount of time searching for SCORM 1.2 API tutorials/examples, which turns out to be quite a difficult task.

The only sample I have found is this: http://www.vsscorm.net/2009/05/30/ground-rules/

It is a solid tutorial but I would like to find some more information from other sources.

All suggestions are appreciated.


Solution

  • Like Andrew mentioned it is really hard to fully implement SCORM yourself. I believe Moodle doesn't even support Scorm 2004.

    AICC is extremely easy to implement by comparison but it harder to do redirects on completion etc.. and has less functionality.

    In my system I have implemented the minimum set of functionality to support simple courses generated with tools like Articulate. Different courses call the api in a different order or get/set different values in the model so you would want to test any new course formats closely. This is what I found to be the hardest part is compensating for the different behavior exhibited by different courses.

    The vsscorm you mentioned is actually the best step by step explanation I have found on how to implement the server side I think he got up to 60 posts as he implemented more and more.
    http://www.vsscorm.net/

    Once you get it communicating with the server the Rustici docs and Run-Time API reference is very helpful for referencing model value descriptions and default values
    http://scorm.com/scorm-explained/technical-scorm/run-time/run-time-reference/

    Pipwerks has some interesting tools and blog posts though they are mostly focused on course creation.
    http://pipwerks.com/downloads/

    Also the ADL docs but it's been a long time since I looked at them. http://www.adlnet.gov/scorm/scorm-version-1-2/

    If you download the Scorm 1.2 version (Basic Run-Time Calls) and place the code posted below in an html file in the root of the course then open that page in the browser via a web server it will make the course think it's inside an LMS enough to not complain and will log all the api calls it makes.
    http://scorm.com/scorm-explained/technical-scorm/golf-examples/

    <html>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
        <script>
            var API = {};
    
            (function ($) {
                $(document).ready(setupScormApi());
    
                function setupScormApi() {
                    API.LMSInitialize = LMSInitialize;
                    API.LMSGetValue = LMSGetValue;
                    API.LMSSetValue = LMSSetValue;
                    API.LMSCommit = LMSCommit;
                    API.LMSFinish = LMSFinish;
                    API.LMSGetLastError = LMSGetLastError;
                    API.LMSGetDiagnostic = LMSGetDiagnostic;
                    API.LMSGetErrorString = LMSGetErrorString;
    
                    window.open("shared/launchpage.html", "popupname","resizable,scrollbars,status");
                }
                function LMSInitialize(initializeInput) {
                    displayLog("LMSInitialize: " + initializeInput);
                    return true;
                }
                function LMSGetValue(varname) {
                    displayLog("LMSGetValue: " + varname);
                    return "";
                }
                function LMSSetValue(varname, varvalue) {
                    displayLog("LMSSetValue: " + varname + "=" + varvalue);
                    return "";
                }
                function LMSCommit(commitInput) {
                    displayLog("LMSCommit: " + commitInput);
                    return true;
                }
                function LMSFinish(finishInput) {
                    displayLog("LMSFinish: " + finishInput);
                    return true;
                }
                function LMSGetLastError() {
                    displayLog("LMSGetLastError: ");
                    return 0;
                }
                function LMSGetDiagnostic(errorCode) {
                    displayLog("LMSGetDiagnostic: " + errorCode);
                    return "";
                }
                function LMSGetErrorString(errorCode) {
                    displayLog("LMSGetErrorString: " + errorCode);
                    return "";
                }
                function displayLog(textToDisplay){
                    var loggerWindow = document.getElementById("logDisplay");
                    var item = document.createElement("div");
                    item.innerText = textToDisplay;
                    loggerWindow.appendChild(item);
                }
            })(jQuery);
        </script>
        <div id="logDisplay">
        </div>
    </html>