Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCORM Learner Data Not Received in Chrome but Works in Safari #50

Open
erick-innosonian opened this issue Feb 20, 2025 · 0 comments
Open

Comments

@erick-innosonian
Copy link

First of all, I just want to express my deep gratitude for this amazing library. It has been an absolute lifesaver 🙏, and I truly appreciate all the hard work that has gone into maintaining it. Thanks to this, I’ve been able to integrate SCORM content much more easily!

I recently encountered an issue where learner data is not being received in Chrome, while everything works perfectly in Safari. I would love to get some insights on how to resolve this.

Steps to Reproduce

  1. When launching SCORM content, dispatch.html automatically opens the content in a popup.
  2. In Safari, learner data is received correctly.
  3. In Chrome, learner data is not received at all.

Learner data should be received in both Chrome and Safari.

This is my sample code.

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Modern Layout</title>
    <style>
        body {
            margin: 0;
            display: grid;
            grid-template-rows: 0fr 1fr;
            height: 100vh;
        }

        iframe {
            width: 100%;
            border: none;
        }

        #api-frame {
            height: 0;
        }

        #course-frame {
            height: 100%;
        }
    </style>
</head>
<body>
<script type="text/javascript" src="/static/simplify-scorm/src/init.js"></script>
<script type="text/javascript" src="/static/simplify-scorm/src/constants.js"></script>
<script type="text/javascript" src="/static/simplify-scorm/src/baseAPI.js"></script>
<script type="text/javascript" src="/static/simplify-scorm/src/jsonFormatter.js"></script>
<script type="text/javascript" src="/static/simplify-scorm/src/scormAPI.js"></script>

<iframe id="course-frame" src="../course/dispatch.html" name="course"></iframe>
<script>
    var json = {
        "suspend_data": "viewed=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31|lastviewedslide=31|7#1##,3,3,3,7,3,3,7,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,11#0#b5e89fbb-7cfb-46f0-a7cb-758165d3fe7e=236~262~2542812732762722742772682802752822882852892872832862962931000~3579~32590001001010101010101010101001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001010010010010010010010010011010010010010010010010010010010010112101021000171000~236a71d398e-4023-4967-88fe-1af18721422d06passed6failed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105wrong110000000000000000000000000000000000~3185000000000000000000000000000000000000000000000000000000000000000000000000000000000~283~2191w11~21113101w41689~256~2100723031840~21007230314509062302670~2110723031061120000000000000000000~240~234531618~21601011000100000002814169400,#-1",
        "core": {
            "student_id": "123",
            "student_name": "Bob The Builder"
        },
        "interactions": {
            "childArray": [
                {
                    "id": "Question14_1",
                    "time": "11:05:21",
                    "type": "choice",
                    "weighting": "1",
                    "student_response": "HTH",
                    "result": "wrong",
                    "latency": "0000:00:01.68",
                    "objectives": {
                        "childArray": [
                            {
                                "id": "Question14_1"
                            }
                        ]
                    },
                    "correct_responses": {
                        "childArray": [
                            {
                                "pattern": "CPR"
                            }
                        ]
                    }
                }
            ]
        }
    };
    window.API.loadFromJSON(json);
    window.API.apiLogLevel = 1; // Log everything (Debug)

</script>
</body>
</html>

This is console log from Chrome

Added pageHide handler to dispatch.html to support browsers where unload is deprecated
baseAPI.js:48 LMSInitialize       : returned: true
baseAPI.js:48 LMSGetValue         : cmi.core.lesson_mode                            : returned: normal
baseAPI.js:48 LMSGetLastError     : returned: 0
baseAPI.js:48 LMSGetValue         : cmi.core.lesson_mode                            : returned: normal
baseAPI.js:48 LMSGetLastError     : returned: 0
baseAPI.js:48 LMSGetValue         : cmi.core.lesson_status                          : returned: 
baseAPI.js:48 LMSGetLastError     : returned: 0
baseAPI.js:48 LMSSetValue         : cmi.core.exit                                   : suspend: returned: true
baseAPI.js:48 LMSGetValue         : cmi.core.student_id                             : returned: 123
baseAPI.js:48 LMSGetLastError     : returned: 0
baseAPI.js:48 LMSGetValue         : cmi.core.student_name                           : returned: Bob The Builder
baseAPI.js:48 LMSGetLastError     : returned: 0
baseAPI.js:48 LMSGetValue         : cmi.core.entry                                  : returned: 
baseAPI.js:48 LMSGetLastError     : returned: 0
baseAPI.js:48 LMSGetValue         : cmi.suspend_data                                : returned: viewed=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31|lastviewedslide=31|7#1##,3,3,3,7,3,3,7,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,11#0#b5e89fbb-7cfb-46f0-a7cb-758165d3fe7e=236~262~2542812732762722742772682802752822882852892872832862962931000~3579~32590001001010101010101010101001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001010010010010010010010010011010010010010010010010010010010010112101021000171000~236a71d398e-4023-4967-88fe-1af18721422d06passed6failed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105wrong110000000000000000000000000000000000~3185000000000000000000000000000000000000000000000000000000000000000000000000000000000~283~2191w11~21113101w41689~256~2100723031840~21007230314509062302670~2110723031061120000000000000000000~240~234531618~21601011000100000002814169400,#-1
baseAPI.js:48 LMSGetLastError     : returned: 0
baseAPI.js:48 LMSSetValue         : cmi.suspend_data                                : 290464483: returned: true
baseAPI.js:48 LMSSetValue         : cmi.core.session_time                           : 0000:00:00.0: returned: true
baseAPI.js:48 LMSSetValue         : cmi.core.lesson_status                          : incomplete: returned: true
baseAPI.js:48 LMSCommit           : returned: true

This is console log from Safari

[Info] Added pageHide handler to dispatch.html to support browsers where unload is deprecated (dispatch.client.loader.v2.js, line 429)
[Info] LMSInitialize       : returned: true (baseAPI.js, line 48)
[Info] LMSGetValue         : cmi.core.lesson_mode                            : returned: normal (baseAPI.js, line 48)
[Info] LMSGetLastError     : returned: 0 (baseAPI.js, line 48)
[Info] LMSGetValue         : cmi.core.lesson_mode                            : returned: normal (baseAPI.js, line 48)
[Info] LMSGetLastError     : returned: 0 (baseAPI.js, line 48)
[Info] LMSGetValue         : cmi.core.lesson_status                          : returned:  (baseAPI.js, line 48)
[Info] LMSGetLastError     : returned: 0 (baseAPI.js, line 48)
[Info] LMSSetValue         : cmi.core.exit                                   : suspend: returned: true (baseAPI.js, line 48)
[Info] LMSGetValue         : cmi.core.student_id                             : returned: 123 (baseAPI.js, line 48)
[Info] LMSGetLastError     : returned: 0 (baseAPI.js, line 48)
[Info] LMSGetValue         : cmi.core.student_name                           : returned: Bob The Builder (baseAPI.js, line 48)
[Info] LMSGetLastError     : returned: 0 (baseAPI.js, line 48)
[Info] LMSGetValue         : cmi.core.entry                                  : returned:  (baseAPI.js, line 48)
[Info] LMSGetLastError     : returned: 0 (baseAPI.js, line 48)
[Info] LMSGetValue         : cmi.suspend_data                                : returned: viewed=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31|lastviewedslide=31|7#1##,3,3,3,7,3,3,7,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,11#0#b5e89fbb-7cfb-46f0-a7cb-758165d3fe7e=236~262~2542812732762722742772682802752822882852892872832862962931000~3579~32590001001010101010101010101001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001010010010010010010010010011010010010010010010010010010010010112101021000171000~236a71d398e-4023-4967-88fe-1af18721422d06passed6failed000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000105wrong110000000000000000000000000000000000~3185000000000000000000000000000000000000000000000000000000000000000000000000000000000~283~2191w11~21113101w41689~256~2100723031840~21007230314509062302670~2110723031061120000000000000000000~240~234531618~21601011000100000002814169400,#-1 (baseAPI.js, line 48)
[Info] LMSGetLastError     : returned: 0 (baseAPI.js, line 48)
[Info] LMSSetValue         : cmi.suspend_data                                : 290464483: returned: true (baseAPI.js, line 48)
[Info] LMSSetValue         : cmi.core.session_time                           : 0000:00:00.0: returned: true (baseAPI.js, line 48)
[Info] LMSSetValue         : cmi.core.lesson_status                          : incomplete: returned: true (baseAPI.js, line 48)
[Info] LMSCommit           : returned: true (baseAPI.js, line 48)
[Error] Failed to load resource: the server responded with a status of 404 (404) (scorm12-min.js.map, line 0)
[Info] LMSSetValue         : cmi.core.session_time                           : 0000:00:15.0: returned: true (baseAPI.js, line 48)
[Info] LMSSetValue         : cmi.core.session_time                           : 0000:00:30.0: returned: true (baseAPI.js, line 48)

Environment

  • SCORM Version: SCORM1.2
  • Browser:
    • Chrome (Version 133.0.6943.55) - ❌ Learner data not received
    • Safari (Version 17.5 (19618.2.12.11.6)) - ✅ Works fine
  • Content is from my client's cloud scorm

I would appreciate any ideas or suggestions on how to debug and resolve this.
Again, thank you so much for this fantastic library! Any guidance or suggestions would be greatly appreciated. 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant