原文出處
- 電華教育研究雜志2010年第7期《SCORM標准學習跟蹤機制的研究與實現》
- http://blog.sina.com.cn/s/blog_964ec55001014nl0.html
一般步驟
- 運行SCORM APIAdapter。
- 調用API初始化函數。
- 加載課件SCO初始化數據。
- 獲取Data Model中的用戶ID和用戶姓名。
- 獲取Data Model中cmi.core.lesson_status值,即當前用戶對當前SCO的學習狀態,包括passed (通過) completed (已完成) browsed (瀏覽) incomplete (非完成) failed (失敗) not attempted (未嘗試) 6種狀態。
- 獲取數據模型中的cmi.core.entry 值,該值判斷當前用戶是否第一次學習當前SCO。如果值為“ab-initio”, 則表示當前用戶是首次學習; 如果值為“resume”,則表示用戶是再次學習當前SCO。
- 獲取數據模型中的cmi.core.lesson_mode 值,該值判斷當前用戶訪問當前SCO 的方式,包括Browse(預覽, 不跟蹤學習)、Normal ( 跟蹤學習)、Review ( 復習) 三種模式;
- 獲取數據模型中的cmi.core.score.raw 值,該值用來存放每一個學員在每一個SCO 的學習過程中所累積的總成績。如果當前SCO有評測就會記錄當前用戶的評測總成績,沒有就不記錄。LMS 可借此Data Model 作學習者成績分析。如果用戶是初次學習當前SCO, 系統就會初始化cmi.core.score.raw 的值為“”(空值)。
- 獲取數據模型中的cmi.core.lesson_location 值。LMS 借此Data Model 記錄每一個用戶最后一次學習哪一個SCO,以便下一次重新進入該課程時可以直接跳轉到上次學習位置繼續學習, 相當於書簽的功能。
- 用戶開始學習當前SCO,在學習過程中會記錄一系列數據模型的值, 用於學習跟蹤。其中 cmi.core.session_time 用來記錄每個學員每次學習的時間, 包括每個用戶進入每個SCO 的停留時間及訪問的日期。在當前用戶結束對當前SCO 的學習時,LMS 則會記錄cmi.core.total_time 的值,cmi.core.total_time 表示當前用戶對每個SCO 學習所花的總時間。
- 執行LMSCommit(Parameter)接口函數。該函數主要是用來提交數據模型元素的值, LMSCommit發生在LMSfinish 之前。
- 執行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內部的記錄跟平台是沒有關系的。
passed
(通過)
|
completed
(已完成)
|
browsed
(瀏覽)
|
incomplete
(非完成)
|
failed
(失敗)
|
not attempted
(未嘗試)
|
- 當LMS啟動SCO時,必須將狀態初始化為“not attempted”。
- 當LMS收到LMSFinish的命令,但lesson_status的狀態不是“not attempted”或“incompleted”時,則必須重新檢驗其狀態。
- 當cmi.core.credit的值為“credit”,而且cmi.student_data.mastery_score與cmi.core.score均含有成績時,比較兩者的分數。若mastery_score大於score, 則更改lesson_status的值為“passed”,反之則更改為“failed”。
- 當cmi.core.credit的值為“credit”,但是cmi.student_data.mastery_score沒有成績時,則維持lesson_status的值不變,也就是保留SCO設定的值。
- 當cmi.core.credit的值為“no-credit”時,而且cmi.core.lesson_mode為 “browse”時,更改其值為“browsed”。
- 當cmi.core.credit的值為“no-credit”時,但是cmi.core.lesson_mode不為“browse”或元素根本不存在時,維持lesson_status的值不變,也就是保留SCO設定的值。
5. cmi.core.exit
根據學習時間的判斷sco的完成狀態
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 |
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 |
|
評語、注解、說明等 |
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"; //中立
1) LMSInitilize
LMSInitialize 負責啟動SCO,當學習者進入開始閱讀一個SCO時,SCO第一步就是先要呼叫LMSInitialize,LMSInitialize function判斷該學員之上課記錄,當學員第一次閱讀該門課的該SCO時,LMSInitialize就會將設定初值至相關的環境變量;若學習者並不是第一次閱讀該SCO,LMSInitialize則必須將該學習者之前的上課記錄取出,並存入環境變量中,如此即完成啟動SCO之動作。
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的上課記錄回存。
var result = LMSFinish("");
3) LMSGetValue
LMSGetValue 主要負責將數據由LMS取出,當SCO呼叫LMSGetValue時,LMSSetValue會先判斷data model是否可以讀取,若不可讀取,則寫入其錯誤代碼;若該data model是可以讀取,則進取出其值並回傳給SCO。但在設計時,如同LMSSetValue並沒有直接和receiver相連,所以是將數據由暫存的內存中取出。
// 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:
在LMSSetValue 是相當復雜的Function,負責儲存所有相關的學習記錄,當SCO呼叫欲將某個data model回存時,LMSSetValue第一步先判斷所欲回存之data model,判斷該data model是否可以set(寫入),其次判斷其型別,當型別錯誤時,記錄其Error Code,當型別檢查通過時,則依SCORM1.2 RTE所訂定該data model的處理規則,並將數據存入內存中。
var result = LMSSetValue("cmi.core.score.raw","95");
5) LMSCommit
相較於LMSSetValue和LMSGetValue,LMSCommit可以說簡單多了,其主要負責將所有暫存在內存中的學習記錄,回存到LMS,在設計時應用了XMLHTTP之技術,所以當LMSCommit被呼叫時,會將所有之暫存數據組成XML文件,再應用XMLHTTP對象將數據POST到 Receiver,當Receiver收到這個Request時,就會解譯所傳入之XML文件,再將XML文件中的數據直接存入數據庫中。
var result = LMSCommit("");
6) GetLastError
該函數將返回一個錯誤代碼,每次API function呼叫后,該函數的值將被重置。(LMSGetErrorString及LMSGetDiagnostic除外)。
var errorCode = LMSGetLastError();
7) GetErrorString
var errorString = LMSGetErrorString("403");
8) LMSGetDiagnostic
var moreInfo = LMSGetDiagnostic("403");