从Camtasia Studio生成的课件看SCORM

参考   https://blog.csdn.net/cooldragon/article/details/19006835

https://wenku.baidu.com/view/a0bd5ca5284ac850ad02427b.html

D:\CAMTASIA STUDIO\NOI_EMACS_GDB
│  adlcp_v1p3.xsd
│  imscp_v1p1.xsd
│  imsmanifest.xml
│  NOI_emacs_gdb.html
│  NOI_emacs_gdb.js
│  NOI_emacs_gdb.mp4
│  NOI_emacs_gdb.zip                               这是打包了其他所有文件的SCORM包
│  NOI_emacs_gdb_config.xml
│  NOI_emacs_gdb_controller.swf
│  NOI_emacs_gdb_embed.css
│  NOI_emacs_gdb_First_Frame.png
│  NOI_emacs_gdb_player.html
│  playerProductInstall.swf
│  scormwrapper.js

├─scripts
│      config_xml.js
│      handlebars.js
│      jquery-1.7.1.min.js
│      jquery-ui-1.8.15.custom.min.js
│      modernizr.js
│      player-min.js
│      swfobject.js

└─skins
    └─overlay
            player-min.css
            spritesheet.png

实际生成的主要是一个mp4文件,然后SCORM课件就是打包了一堆HTML、XML、JS的zip包(包含了内容包所有文件)

imsmanifest.xml这个文件是主配置文件,顶级元素<manifest>,下面包括3个节点:<metadata>描述内容包整体情况、<organizations>包含学习内容的结构(相同学习内容可以有多种组织形式,一定有一个默认组织形式)、<resources>定义学习包中的资源,如果是4个节点,第4个是(sub)Manifest(s),用来定义下级manifest文件

adlcp_v1p3.xsd和imscp_v1p1.xsd这两个xsd,被主配置文件imsmanifest.xml文件引用,从前缀ADL项目(SCORM模型)和IMS项目(内容打包规范)看,是定义了这两个东西里用到的数据类型之类的构件模块

在主配置文件中,存在类似如下的信息:

<organizations default="TOC1">
      <organization identifier="TOC1">
         <title>Camtasia Video Course</title>
         <item identifier="I_SCO0" identifierref="SCO0">
            <title>Untitled</title>
            <adlcp:masteryscore>0</adlcp:masteryscore>
         </item>

      </organization>
   </organizations>

   <resources>
      <resource identifier="SCO0" type="webcontent" adlcp:scormType="sco" href="NOI_emacs_gdb.html">
            <file href="NOI_emacs_gdb.html"/>
            <dependency identifierref="ALLRESOURCES" />
         </resource>

      <resource identifier="ALLRESOURCES" type="webcontent" adlcp:scormType="asset">
         <file href="NOI_emacs_gdb.html" />
            <file href="scripts/jquery-1.7.1.min.js" />

……

即默认学习内容的组织形式是标识为TOC1的那个,这个组织形式里的项目I_SCO0引用了标识为SCO0的资源。从资源部分可以知道,SCO0资源就是链接到NOI_emacs_gdb.html文件(同时依赖ALLRESOURCES资源),所以,这个html文件就是主入口了。

NOI_emacs_gdb.html文件就是一个普通的网页文件,关键部分是用<iframe>插入了一个html文件NOI_emacs_gdb_player.html:

<body>
<iframe class="tscplayer_inline" name="tsc_player" src="NOI_emacs_gdb_player.html" scrolling="no" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</body>

NOI_emacs_gdb_player.html文件的一些代码如下:

<body οnunlοad="pageUnload();">

<div id="tscVideoContent"></div>

<script type="text/javascript" src="NOI_emacs_gdb.js"></script>
<script type="text/javascript" src="scormwrapper.js"></script>
<script src="scripts/jquery-1.7.1.min.js" ></script>
<script src="scripts/jquery-ui-1.8.15.custom.min.js" ></script>
<script src="scripts/swfobject.js"></script>
<script src="scripts/modernizr.js"></script>
<script src="scripts/handlebars.js"></script>

<script src="scripts/config_xml.js"></script>
<script src="scripts/player-min.js" charset="utf-8"></script>
<script type="text/javascript">
    TSC.playerConfiguration.setFlashPlayerSwf("NOI_emacs_gdb_controller.swf");  这里及以下是有关播放器的一堆设置
    TSC.playerConfiguration.setMediaSrc("NOI_emacs_gdb.mp4");
    TSC.playerConfiguration.setXMPSrc("NOI_emacs_gdb_config.xml");
    
    TSC.playerConfiguration.setAutoHideControls(true);
    TSC.playerConfiguration.setBackgroundColor("#000000");
    TSC.playerConfiguration.setCaptionsEnabled(false);
    TSC.playerConfiguration.setSidebarEnabled(false);
    
    TSC.playerConfiguration.setAutoPlayMedia(false);
    TSC.playerConfiguration.setPosterImageSrc("NOI_emacs_gdb_First_Frame.png");
    TSC.playerConfiguration.setIsSearchable(false);
    TSC.playerConfiguration.setEndActionType("stop");
    TSC.playerConfiguration.setEndActionParam("true");
    TSC.playerConfiguration.setAllowRewind(-1);
    
    TSC.playerConfiguration.setReportScormComplete(true);

    TSC.localizationStrings.setLanguage(TSC.languageCodes.ENGLISH);

    $(document).ready(
       function (e)
       {
          initSCORM();                在文件NOI_emacs_gdb.js中,调用API和LMS平台通信,初始化学习进度等
          TSC.mediaPlayer.init("#tscVideoContent");   应该在scripts/player-min.js中,在指定div上初始化播放器
          loadPage();                  在文件NOI_emacs_gdb.js中,设置变量completionStatus = "incomplete"
       }
    );
</script>

</body>

调用的API来自scormwrapper.js这个API包装文件,该文件定义了apiCall,findAPI,getAPI,getAPIHandle函数,基本原理是getAPIHandle调用getAPI获得句柄,在apiCall内调用LMS平台的功能前,需要先获取此句柄。而getAPI是调用findAPI从各级父窗口搜索得到句柄的。

在moodle中,查看网页源码,可以看到:

<script type="text/javascript" src="http://10.5.10.74/moodle/lib/javascript.php/1509937333/mod/scorm/request.js"></script>
<script type="text/javascript" src="http://10.5.10.74/moodle/lib/javascript.php/1509937333/mod/scorm/datamodels/scorm_13.js"></script>

后面那个js的末尾,存在以下代码:

M.scorm_api={};

M.scorm_api.init=function(Y,def,cmiobj,cmiint,cmicommentsuser,cmicommentslms,scormdebugging,scormauto,scormid,cfgwwwroot,sesskey,scoid,attempt,viewmode,cmid,currentorg,autocommit){

window.API_1484_11=new SCORMapi1_3(def,cmiobj,cmiint,cmicommentsuser,cmicommentslms,scormdebugging,scormauto,scormid,cfgwwwroot,sesskey,scoid,attempt,viewmode,cmid,currentorg,autocommit)

}

注意到window.API_1484_11这个对象,正是包装文件scormwrapper.js中的函数findAPI中“苦苦”查找的东西:

function findAPI( win )
{
    var findAPITries = 0;
    var theAPI       = null;
    // Search each parent window until we find the API, encounter a window with no parent / the 
    // same as the current window, or have reached our MAX_PARENTS_TO_SEARCH to search threshold
    
    while ( ( win.API_1484_11 == null                  ) 
          && ( win.API         == null                  ) 
          && ( win.parent      != null                  ) 
          && ( win.parent      != win                   ) 
          && ( findAPITries    <= MAX_PARENTS_TO_SEARCH ) )
    {
        findAPITries++;
        win = win.parent;
    }
    if ( win.API_1484_11 != null )
    {
        apiVersion = 1;
        theAPI = win.API_1484_11;
    }
    else if ( win.API != null )
    {
        apiVersion = 0;
        theAPI = win.API;    
    }
    return theAPI;
}

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值