Scorm 1.2 开发文档

原文出处

  1. 电华教育研究杂志2010年第7期《SCORM标准学习跟踪机制的研究与实现》
  2. http://blog.sina.com.cn/s/blog_964ec55001014nl0.html

一般步骤

  1. 运行SCORM APIAdapter。
  2. 调用API初始化函数。
  3. 加载课件SCO初始化数据。
  4. 获取Data Model中的用户ID和用户姓名。
  5. 获取Data Model中cmi.core.lesson_status值,即当前用户对当前SCO的学习状态,包括passed (通过) completed (已完成) browsed (浏览) incomplete (非完成) failed (失败) not attempted (未尝试) 6种状态。
  6. 获取数据模型中的cmi.core.entry 值,该值判断当前用户是否第一次学习当前SCO。如果值为“ab-initio”, 则表示当前用户是首次学习; 如果值为“resume”,则表示用户是再次学习当前SCO。
  7. 获取数据模型中的cmi.core.lesson_mode 值,该值判断当前用户访问当前SCO 的方式,包括Browse(预览, 不跟踪学习)、Normal ( 跟踪学习)、Review ( 复习) 三种模式;
  8. 获取数据模型中的cmi.core.score.raw 值,该值用来存放每一个学员在每一个SCO 的学习过程中所累积的总成绩。如果当前SCO有评测就会记录当前用户的评测总成绩,没有就不记录。LMS 可借此Data Model 作学习者成绩分析。如果用户是初次学习当前SCO, 系统就会初始化cmi.core.score.raw 的值为“”(空值)。
  9. 获取数据模型中的cmi.core.lesson_location 值。LMS 借此Data Model 记录每一个用户最后一次学习哪一个SCO,以便下一次重新进入该课程时可以直接跳转到上次学习位置继续学习, 相当于书签的功能。
  10. 用户开始学习当前SCO,在学习过程中会记录一系列数据模型的值, 用于学习跟踪。其中 cmi.core.session_time 用来记录每个学员每次学习的时间, 包括每个用户进入每个SCO 的停留时间及访问的日期。在当前用户结束对当前SCO 的学习时,LMS 则会记录cmi.core.total_time 的值,cmi.core.total_time 表示当前用户对每个SCO 学习所花的总时间。
  11. 执行LMSCommit(Parameter)接口函数。该函数主要是用来提交数据模型元素的值, LMSCommit发生在LMSfinish 之前。
  12. 执行LMSFinish()函数。当用户学习完并要离开一个SCO时,便会调用LMSFinish()。LMSFinish() 主要负责将环境变量重设,并判断该SCO是否在结束之前己经调用LMSCommit()将所有记录存储到LMS。若尚未储存,则会自动调用LMSCommit()将当前用户在当前SCO 的学习记录保存。
平台中记录跟踪参数 

1. cmi.core.total_time

这个参数是指学习本sco用的总时间,只能读,不能写,它由平台自动累加,而在课程中只需上传每次学习sco的时间,即回话时间(cmi.core.session_time),即可。当然,在从平台读取数据时,还是要取一次的。 

var totalTime = doLMSGetValue("cim.core.total_time");
alert("您目前这个单元的总学习时长时间是:" + totalTime);

2. cmi.core.score.raw

这个参数是测试成绩,可读可写。如果不上传,则为空,在平台计算成绩时就不会计算在内。如果上传,则至少为0。有的平台,要求计算课程的平均得分,sco中没有测试题,不用上传成绩,则最好去掉上传成绩的语句,不让会把整个课程的平均成绩拉下来的。 

3. cmi.core.lesson_location

这个参数是记录上次离开sco时的位置,课件读取后,可依次进入到上次离开的位置,当然,这要在课程中做相应的设置才行。 

4. cmi.core.lesson_status

记录sco的完成情况,包括not attempted(未尝试/未学习)、incomplete(未完成),completed(已完成)。在平台上,课程的进度实际上是(已完成的sco数/sco总数)×100%。所以若是单sco的课程,就则只有两种,0%和100%。而sco内部的记录跟平台是没有关系的。 

cmi.core.lesson_staus是专门形容SCO本身的学习情况,总共分为下面六种,而这些状态由SCO与LMS共同维护。
passed
(通过)
completed
(已完成)
browsed
(浏览)
incomplete
(非完成)
failed
(失败)
not attempted
(未尝试)
 
当LMS发行SCO时,必须将学习状态值初始化为“not attempted”,接着将状态的控制权转移给SCO。至于SCO可以采用不同的策略决定何时将学习状态值由“not attempted”转换至“incomplete”,例如:某教师认为当学习者进入SCO时,SCO就应转换至“incomplete”的状态,另外可能也有教师认为学习者必须符合某些条件或执行某些操作时,SCO才能转换至“incomplete”的状态,这些完全取决于教学设计者的考虑,并没有任何使用上的限制。教学设计者可以在学习者完成此SCO的学习时,将学习状态值转换至“completed”,至于认定学习者完成学习的方式与作法,也是由教学设计者自行决定。而且SCO可以根据不同的衡量方式将学习状态值转换至“passed”或者“failed”的状态。 
虽然SCO可以设定学习状态值,但是SCORM并没有强制规定SCO必须设定学习状态值,因此LMS必须采取下列对应的处理方式,维持学习状态值。 
  1. 当LMS启动SCO时,必须将状态初始化为“not attempted”。
  2. 当LMS收到LMSFinish的命令,但lesson_status的状态不是“not attempted”或“incompleted”时,则必须重新检验其状态。
  3. 当cmi.core.credit的值为“credit”,而且cmi.student_data.mastery_score与cmi.core.score均含有成绩时,比较两者的分数。若mastery_score大于score, 则更改lesson_status的值为“passed”,反之则更改为“failed”。
  4. 当cmi.core.credit的值为“credit”,但是cmi.student_data.mastery_score没有成绩时,则维持lesson_status的值不变,也就是保留SCO设定的值。
  5. 当cmi.core.credit的值为“no-credit”时,而且cmi.core.lesson_mode为 “browse”时,更改其值为“browsed”。
  6. 当cmi.core.credit的值为“no-credit”时,但是cmi.core.lesson_mode不为“browse”或元素根本不存在时,维持lesson_status的值不变,也就是保留SCO设定的值。

5. cmi.core.exit

当非正常退出时,会设置为suspend(悬挂,即暂停的意思)
 

根据学习时间的判断sco的完成状态

利用学习者进入该sco学习过的学习时间与视频的时间长短来进行比较,从而达到来判断他学习时间是不是符合完成的状态判断,否则为未完成状态。RTE中提供的元素未cmi.core.total_time。
var time=doLMSGetValue( "cmi.core.total_time");
arr=time.split(":");
hh=Number(arr[0]);
mm=Number(arr[1]);
ss=Number(arr[2]);

hms=hh*3600+mm*60+ss + currentSeconds;
alert(hms);

if (hms>=60){  //这里设定的时间60秒,这个时间可以自己根据本节sco的视频学习时间需求进行更改。
    result = doLMSSetValue("cmi.core.lesson_status", "completed");
} else {
    result = doLMSSetValue("cmi.core.lesson_status", "imcomplete");
}

SCORM1.2中主要Datamodel含义

element

Supported

Use

Possible values

Limitations

cmi.core.lesson_status

Yes

 存储完成状态

Not Attempted
In Progress
Completed
Incomplete
Passed
Failed

Must be one of the strings listed in the possible values column

cmi.core.suspend_data

Yes

To store any information that the course needs to function

Free text

No special characters. Supported characters  are ",", ":"

cmi.core.score.raw

Yes

To store the number/weightage of questions answered correctly  in a test

Takes a number

考试分数

cmi.core.score.max

Yes

To store the total number/weightage of questions in a test

Takes a number

 

cmi.core.score.min

Yes

The minimal number/weightage of questions in a test(usually 0)

Takes a number

 

cmi._version

Yes

Represents the version of the data model

The value is 1.2 for this version

 版本

cmi.core.student_name

Yes

Name provided for the learner by the LMS

 

 

cmi.core.student.id

Yes

Login ID provided for the learner by the LMS

 

 

cmi.core.lesson_location

Yes

Represents the last page visited before the learner quits the course.

Can be decided by the ourseware

 

cmi.core.credit

Yes

Indicates if the learner will be credited for performance for this SCO.

 

Only field value "Credit" supported

cmi.core.entry

Yes

Checks if the learner has already entered the course before

ab-initio

resume

""

"Ab-initio" and "Resume" are the possible values that will be returned

通过API(APIAdapterApplet)来更新,课件中不直接赋值,其根据exit参数来确定。

cmi.core.total_time

Yes

Returns the time spent by the learner in a SCO

 

 章节总学习时间

cmi.core.lesson_mode

Yes

Returns the mode in which the sco is presented to the learner

review 回顾

browse 浏览

Currently only "Normal" is supported

课件展现形式,比如choice、auto

cmi.core.exit

Yes

Indicates the state of exit(logout, suspend etc)

"time-out"、"suspend"、"logout"、""

 课件中的js直接赋值,其主要发生在跳转、暂停、关闭等操作时

cmi.core.session_time

Yes

Indicates the time spent on the SCO in this session

 

 章节的某次学习时长

cmi.launch_data

Yes

Any data provided by the LMS(From the manifest) to the SCO after the launch

 

 

cmi.comments

Yes

Storing any comments

 

Has a limitation of 4k for the data

cmi.comments_from_lms

Yes

Storing any comments from LMS

 

 评语、注解、说明等

 
1)   model类型:

   list[0] = "normal";     //正常

   list[1] = "review";    //回顾

   list[2] = "browse";    //浏览

2)   status类型:

   list[0] = "passed";   //通过

   list[1] = "completed";//完成

   list[2] = "failed";     //失败

   list[3] = "incomplete";//未完成

   list[4] = "browsed";    //浏览

   list[5] = "not attempted";//未参加

3)   Exit类型:

   list[0] = "";           //空,可能是强制退出或是未退出的状态

   list[1] = "time-out";   //超时后退出

   list[2] = "suspend";    //暂停(非正常退出时标识为“挂起”状态)

   list[3] = "logout";     //正常退出

4)   Credit类型:(学分)

   list[0] = "credit";     //有学分

   list[1] = "no-credit";//无学分

5)   Entry类型:  (是否已进入)

   list[0] = "";           //空(已完成)  有待讨论

   list[1] = "ab-initio";  //中间

   list[2] = "resume";     //重新开始

6)   TimeLimitAction类型:时间界限

   list[0] = "";                  //空

   list[1] = "exit,message";      //退出,反馈信息

   list[2] = "exit,no message";   //退出,无反馈信息

   list[3] = "continue,message";   //继续,反馈信息

   list[4] = "continue,no message";//继续,无反馈信息

7)   Interaction类型:课件与平台产生的交互信息

   list[0] = "true-false";  //true or false

   list[1] = "choice";     //选择

   list[2] = "fill-in";      //填写

   list[3] = "matching";   //搭配

   list[4] = "performance";//性能

   list[5] = "likert";       //?

   list[6] = "sequencing";  //排序

   list[7] = "numeric";    //数字

8)   result类型:结果

   list[0] = "correct"; //正确

   list[1] = "wrong";   //错误

   list[2] = "unanticipated";//非正常

   list[3] = "neutral"; //中立

 
API
 
在SCORM标准中,SCO与LMS的通讯是由API Adapter来完成的。(APIWrapper.js)
 
在SCORM1.2的标准中,API定义了8个主要的function,分别是LMSInitilize, LMSFinish, LMSSetValue, LMSGetValue, LMSCommit, LMSGetLastError, LMSGetErrorString, LMSGetDiagnostic,其中又以LMSGetValue和LMSSetValue最为复杂,以下的流程图是主要几个function的逻辑流程。
 
SCORM1.2提供8个标准API,即LMSInitilize、LMSGetValue、LMSSetValue、LMSCommit、LMSFinish、LMSGetLastError、LMSGetErrorString、LMSGetDiagnostic。

1) LMSInitilize

负责建立学习对象与平台之间的数据传输管道。当学习者进入开始阅读一个SCO时,SCO第一步就是先要呼叫LMSInitialize,LMSInitialize function判断该学员之上课记录,当学员第一次阅读该门课的该SCO时,LMSInitialize就会将设定初值至相关的环境变量;若学习者并不是第一次阅读该SCO,LMSInitialize则必须将该学习者之前的上课记录取出,并存入环境变量中,如此即完成启动SCO之动作。

LMSInitialize 负责启动SCO,当学习者进入开始阅读一个SCO时,SCO第一步就是先要呼叫LMSInitialize,LMSInitialize function判断该学员之上课记录,当学员第一次阅读该门课的该SCO时,LMSInitialize就会将设定初值至相关的环境变量;若学习者并不是第一次阅读该SCO,LMSInitialize则必须将该学习者之前的上课记录取出,并存入环境变量中,如此即完成启动SCO之动作。

Example:
var result = LMSInitialize("")
if (result == "false"){
     // Do some error handling
} else {
     // continue with the execution of the SCO
}

2) LMSFinish

负责结束学习对象与平台之间的数据传输管道。当学习者阅读完并要离开一个SCO时,在结束时SCO便会将呼叫LMSFinish,LMSFinish主要负责将环境变量重设,并判断该SCO是否在结束之前己经有呼叫LMSCommit将所有记录回存至LMS,若尚未储存,则会自动呼叫将所有学习者在该SCO的上课记录回存。

当学习者阅读完并要离开一个SCO时,在结束时SCO便会将呼叫LMSFinish,LMSFinish主要负责将环境变量重设,并判断该SCO是否在结束之前己经有呼叫LMSCommit将所有记录回存至LMS,若尚未储存,则会自动呼叫将所有学习者在该SCO的上课记录回存。

Examples:
var result = LMSFinish("");

3) LMSGetValue

负责将学员的学习数据由LMS取出。当SCO呼叫LMSGetValue时,LMSSetValue会先判断data model是否可以读取,若不可读取,则写入其错误代码;若该data model是可以读取,则进取出其值并回传给SCO。但在设计时,如同LMSSetValue并没有直接和receiver相连,所以是将数据由暂存的内存中取出。

LMSGetValue 主要负责将数据由LMS取出,当SCO呼叫LMSGetValue时,LMSSetValue会先判断data model是否可以读取,若不可读取,则写入其错误代码;若该data model是可以读取,则进取出其值并回传给SCO。但在设计时,如同LMSSetValue并没有直接和receiver相连,所以是将数据由暂存的内存中取出。

Examples:
// A typical return value might be "Hyde, Jackson".
var value = LMSGetValue("cmi.core.student_name");

// A typical return value might be "incomplete".
var value = LMSGetValue("cmi.core.lesson_status");

var value = LMSGetValue(“cmi._version”);

4) LMSSetValue:

负责储存学员之学习信息。当SCO呼叫欲将某个data model回存时,LMSSetValue第一步先判断所欲回存之data model,判断该data model是否可以set(写入),其次判断其型别,当型别错误时,记录其Error Code,当型别检查通过时,则依SCORM 1.2 RTE所订定该data model的处理规则,并将数据存入内存中。

在LMSSetValue 是相当复杂的Function,负责储存所有相关的学习记录,当SCO呼叫欲将某个data model回存时,LMSSetValue第一步先判断所欲回存之data model,判断该data model是否可以set(写入),其次判断其型别,当型别错误时,记录其Error Code,当型别检查通过时,则依SCORM1.2 RTE所订定该data model的处理规则,并将数据存入内存中。

Examples:
var result = LMSSetValue("cmi.core.score.raw","95");

5) LMSCommit

负责将章节的所有学习信息数据写入到学习文件中。

相较于LMSSetValue和LMSGetValue,LMSCommit可以说简单多了,其主要负责将所有暂存在内存中的学习记录,回存到LMS,在设计时应用了XMLHTTP之技术,所以当LMSCommit被呼叫时,会将所有之暂存数据组成XML文件,再应用XMLHTTP对象将数据POST到 Receiver,当Receiver收到这个Request时,就会解译所传入之XML文件,再将XML文件中的数据直接存入数据库中。

Examples:
var result = LMSCommit("");

6) GetLastError

负责获取学习时产生的错误代码。

该函数将返回一个错误代码,每次API function呼叫后,该函数的值将被重置。(LMSGetErrorString及LMSGetDiagnostic除外)。

Examples:
var errorCode = LMSGetLastError();

7) GetErrorString

负责将错误代码转化为错误
Examples:
var errorString = LMSGetErrorString("403");

8) LMSGetDiagnostic

负责获得针对该错误而进行的处理方式。
 
Examples:
var moreInfo = LMSGetDiagnostic("403");
原文地址:https://www.cnblogs.com/i0air/p/4665295.html