SCORM:使用ASP.NET MVC C#开发SCORM播放器
我正处于使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论