gabrieldoty / simplify-scorm

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

Couldn't use this repo with my scorm2004 4th edition package #37

Closed isaturk66 closed 3 years ago

isaturk66 commented 3 years ago

I have a scorm2004 package that I exported from rise.com with the file structure of this: (You can see simplfy scorm repo files in there as well) image

You can download the said package here.

The launch file is scormcontent/index.html so I imported the scormAPI.js at that file

<script type="text/javascript" src="../simplify-scorm/src/scormAPI.js"></script>

However, I got this error: image

I am new with scorm but I believeI obeyed the given instructions on the README.md which says

To use, you must include the scormAPI.js file, or the minified version scormAPI.min.js, on the launching page of your SCORM 1.2 or SCORM 2004 application.

I hope I made myself clear.

xob commented 3 years ago

You need to include the release file, not the source code files. https://github.com/gabrieldoty/simplify-scorm/releases/tag/2.0.0

isaturk66 commented 3 years ago

How silly of me! I retried with the release file in two ways but couldn't manage to make it work anyway.

Firstly, I included the file and put some hook listeners in the "scormcontent/index.html" file which is the launch file of my scorm2004 application

image

When I ran it, there was no error like the one I encountered before. However, I can not get any log, my hooks are not triggered.

Secondly, I created another file and imported my launch file with an iframe:

<!DOCTYPE html>
<html>
    <head>

        <script type="text/javascript" src="./scormAPI.js"></script>

        <script>
          window.API_1484_11.on("Initialize", function() {
            console.log("Initialize hook")

          });
          window.API_1484_11.on("SetValue", function(CMIElement, value) {
            console.log("set val");
          });   
        </script>
    </head>
    <body>
        <iframe src="./scormcontent/index.html" height="900" width="500" title="Iframe Example"></iframe>

    </body>
</html>

Same problem. No error but there is no log whatsoever even if advance in the scorm training.

Note: There is also no log when I include this line window.API_1484_11.apiLogLevel = 1; // Log everything (Debug)

I expect that I am missing something obvious but I don't think I will be the only one who will miss that obvious think. Therefore, This issue may serve as a dummy guide when the problem is solved

isaturk66 commented 3 years ago

Turns out I missed something obvious!! Dear SCORM beginners, your launch file is not scormcontent/index.html, it is scormdriver/indexAPI.html. I hope this thread will help someone one day.

jackbaron commented 3 years ago

@isaturk66 What do you use to create content scrom?