感谢您阅读,我希望您能帮助我。
我对SCORM没有多少经验;到目前为止,我一直在SCORM 1.2工作,但我被要求在SCORM 2004中提供一个项目。这是一个直接在Dreamweaver中用HTML5构建的课程,我将JS作为外部文件链接起来。
支持发生什么: 1)据说我存储课程位置,以便当您退出课程并再次打开课程时,从您离开课程的页面开始。不幸的是,它总是从第一页开始。 2)据说上课不应该标记为“完成”#34;直到你到达课程的最后一页,但不幸的是它标志着自己已经完成了#34;一旦你开始上课。
以下是我的代码示例,从三个HTML示例开始(课程的第一页,课程的中间页面和课程的最后一页),然后是两个带有SCORM功能的JS文件。
1)HTML:课程的第一页。
<script type="text/javascript" language="javascript" name="mm_scormRTI" src="SCOfunctions.js"></script>
<script language="javascript">
var currentScoPage = scoPage[ i ] ;
SetValue("cmi.location", currentScoPage );
Terminate(); // close out this SCO, we are finished
</script>
<script language="javascript">
Initialize(); // initialize the SCO with the LMS
var currentScoPage = GetValue("cmi.location");
if (currentScoPage != "") {
self.location = currentScoPage;
}else{
currentScoPage = scoPage[0];
}
</script>
</head>
<body onLoad="mm_adlOnload()">
...
2)HTML:课程的中间页面
<script type="text/javascript" language="javascript" name="mm_scormRTI" src="SCOfunctions.js"></script>
<script language="javascript">
var currentScoPage = scoPage[ i ] ;
SetValue("cmi.location", currentScoPage );
Terminate(); // close out this SCO, we are finished
</script>
</head>
<body onLoad="mm_adlOnload()">
...
3)HTML:课程的最后一页
<script type="text/javascript" language="javascript" name="mm_scormRTI" src="SCOcomplete.js"></script>
<script language="javascript">
var currentScoPage = scoPage[ i ] ;
SetValue("cmi.location", currentScoPage );
Terminate(); // close out this SCO, we are finished
</script>
</head>
<body onLoad="mm_adlOnload()" onUnload="mm_adlOnunload()">
...
4)SCORM:外部文件&#34; SCOfunctions.js&#34;
function mm_adlOnload()
{
if (mm_adl_API != null)
{
mm_adl_API.Initialize("");
mm_adl_API.SetValue("cmi.completion_status", "incomplete");
}
}
function mm_adlOnunload()
{
if (mm_adl_API != null)
{
mm_adl_API.SetValue("cmi.completion_status", "incomplete");
mm_adl_API.Commit("");
}
}
GetAPI(window);
var nFindAPITries = 0;
var API = null;
var maxTries = 500;
function ScanForAPI(win)
{
while ((win.API_1484_11 == null) && (win.parent != null) && (win.parent != win))
{
nFindAPITries++;
if (nFindAPITries > maxTries)
{
return null;
}
win = win.parent;
}
return win.API_1484_11;
}
function GetAPI(win)
{
if ((win.parent != null) && (win.parent != win))
{
API = ScanForAPI(win.parent);
}
if ((API == null) && (win.opener != null))
{
API = ScanForAPI(win.opener);
}
}
5)SCORM:外部文件&#34; SCOcomplete.js&#34;
var nFindAPITries = 0;
var API = null;
var maxTries = 500;
function ScanForAPI(win)
{
while ((win.API_1484_11 == null) && (win.parent != null) && (win.parent != win))
{
nFindAPITries++;
if (nFindAPITries > maxTries)
{
return null;
}
win = win.parent;
}
return win.API_1484_11;
}
function GetAPI(win)
{
if ((win.parent != null) && (win.parent != win))
{
API = ScanForAPI(win.parent);
}
if ((API == null) && (win.opener != null))
{
API = ScanForAPI(win.opener);
}
}
function mm_adlOnload()
{
if (mm_adl_API != null)
{
mm_adl_API.SetValue("cmi.completion_status", "incomplete");
}
}
function mm_adlOnunload()
{
if (mm_adl_API != null)
{
mm_adl_API.SetValue("cmi.completion_status", "completed");
mm_adl_API.Commit("");
mm_adl_API.Terminate("");
}
}
GetAPI();
我做错了什么?如果有人至少有一个类似SCORM 2004项目的工作示例,或者可以看到我可能做错了什么,那将非常感激。
很多,非常感谢提前!
答案 0 :(得分:0)
您在Terminate()
之后立即致电SetValue()
。您必须在Commit()
之后调用SetValue()
以在数据库中保留(保存)数据。否则你在没有保存任何东西的情况下退出SCO。
另外,您是否检查过以确保scoPage[i]
的值准确无误?
答案 1 :(得分:0)
建立你的榜样,结合其他事情。
因此,如果您有一个由单个页面组成的课程/单元/章节(imsmanifest.xml)作为他们查看的每个页面,您将要自动对其进行评分或将其基于他们正在与之交互的内容。
终止()
全部取决于您的单页与多页。如果单页您正常退出,则无需书签。 LMS将标记TOC中的每个项目在您进展时已完成/评分。
祝你好运