gabrieldoty / simplify-scorm

Scorm 1.2 Javascript API
MIT License
230 stars 77 forks source link

Unable to find a API Adaptor #22

Closed sureshmariadass closed 4 years ago

sureshmariadass commented 5 years ago

Hi, I am testing that scorm API adaptor. It returned "unable to find a API adaptor". Can anyone help me?

This is my code:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Scorm Test</title>
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"
  integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
  crossorigin="anonymous"></script>

<style>
    iframe {
        width: 900px;
        height: 600px;
        position: absolute;
        left:0;
        right: 0;
        top:0;
        bottom: 0;
        margin: auto;
    }
</style>
</head>

<body>
    <iframe src="GOLF12/shared/launchpage.html" frameborder="0"></iframe>
    <button onclick="save()">Save</button>

    <script type="text/javascript" src="src/scormAPI.js"></script>
    <script>
        $(document).ready(function() {
            window.API.cmi.core.student_id = 101;
        });
        function save() {
            var simplifiedObject = window.API.cmi.toJSON();
            console.log(simplifiedObject);
        }
    </script>
</body>

</html>

GOLF12/shared/launchpage.html is scorm course path. An error has returned the following screenshots:

image

image

sureshmariadass commented 5 years ago

I solved those issues. Your code is awesome. Thanks a lot...

mluo6208 commented 4 years ago

Hey man. Could you please advise how you solved the issue?

xob commented 4 years ago

My guess is that they had only loaded part of the project. You must load the release file (either the minified version or the full version) for it to work.

https://github.com/gabrieldoty/simplify-scorm/releases/tag/1.1.0

mluo6208 commented 4 years ago

Beautiful stuff man. I worked it out. Cheers!