SCORM:使用ASP.NET MVC C#开发SCORM播放器

发布于 2025-02-01 02:09:23 字数 2963 浏览 5 评论 0原文

我正处于使用 scorm Player 使用 MVC ASP.NET 的初始阶段。如何在ASP.NET MVC中使用SCORM。 请在MVC网站上开发播放器时提供一些帮助。我还需要集成部分的帮助。 以下样本是从网络中取出的,并且工作正常。我需要使用ASP.NET MVC对此进行集成。

<HTML>
<head>
<script 
src="https://ajax.googleapis.com/ajax/libs
/jquery/1.11.2/jquery.min.js"></script>
<script>
    var API = {};

    (function ($) {
        $(document).ready(function () {
            setupScormApi()

            $('#content').attr('src', 
     "file:///E:/Projects/SCORM/Sample/SCORM%20- 
    %20Storyline%20output/story.html")
        });

        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;
        }

        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);
            var height = $('#logDisplay')[0].scrollHeight;
            $('#logDisplay').scrollTop(height);
        }
    })(jQuery);
</script>
</head>
<body style="display: flex; flex-direction: inherit; align-items: 
center; justify-content: center">
<iframe id="content" name="content" style="border: 1px solid 
blue; flex: 11; align-self: stretch" frameborder="0"></iframe>
<div id="logDisplay" style="flex: 1; align-self: stretch; border: 
1px solid red; padding: 5px;    overflow-y: scroll;
overflow-x: hidden;">
</div>
</body>
</html>

I am at the initial stage of developing a SCORM player using MVC ASP.Net. How to use SCORM in ASP.Net MVC.
Please provide some assistance in developing the player on MVC Website. I also need help on the Integrating part.
The following sample was taken from the web and it's working fine. I need to integrate this using ASP.NET MVC.

<HTML>
<head>
<script 
src="https://ajax.googleapis.com/ajax/libs
/jquery/1.11.2/jquery.min.js"></script>
<script>
    var API = {};

    (function ($) {
        $(document).ready(function () {
            setupScormApi()

            $('#content').attr('src', 
     "file:///E:/Projects/SCORM/Sample/SCORM%20- 
    %20Storyline%20output/story.html")
        });

        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;
        }

        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);
            var height = $('#logDisplay')[0].scrollHeight;
            $('#logDisplay').scrollTop(height);
        }
    })(jQuery);
</script>
</head>
<body style="display: flex; flex-direction: inherit; align-items: 
center; justify-content: center">
<iframe id="content" name="content" style="border: 1px solid 
blue; flex: 11; align-self: stretch" frameborder="0"></iframe>
<div id="logDisplay" style="flex: 1; align-self: stretch; border: 
1px solid red; padding: 5px;    overflow-y: scroll;
overflow-x: hidden;">
</div>
</body>
</html>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文