60 likes | 189 Views
SECTION 3 The SCORM TM Run-Time Environment : API 배 일 환 지식정보기술㈜ 교육솔루션사업본부. Learning Management System (LMS). LMS. LMS. Server. Server. Server Side. Client Side. Browser. Data Model. Actual data sent. back and forth. Launch. Asset. between SCO. SCO. and LMS. API. API.
E N D
SECTION 3 The SCORMTM Run-Time Environment : API 배 일 환 지식정보기술㈜ 교육솔루션사업본부
Learning Management System (LMS) LMS LMS Server Server Server Side Client Side Browser Data Model Actual data sent back and forth Launch Asset between SCO SCO and LMS API API JavaScript JavaScript Adapter Adapter API (Communications Link between SCO and LMS) 1. Launch, API, Data model
2. API Adapter • Execution State (실행상태) • - LMSInitialize(“”) , LMSFinish(“”). • State Management (상태관리) • handle errors: • - LMSGetLastError(), LMSGetErrorString(errornumber), • LMSGetDiagnostic(parameter). • Data Transfer (자료이동) • transfer data to and from an LMS: • - LMSGetValue(data model element), • LMSSetValue(data model element, value), LMSCommit("").
LMSInitialize(“”) Initialized LMSFinish(“”) SCO Launched By LMS Finished Not Initialized • SCO can call: • LMSGetValue • LMSSetValue • LMSGetLastError • LMSGetErrorString • LMSGetDiagnositc • LMSCommit • LMSFinish SCO Responsibility:Find the API and CallLMSInitialize • If LMSFinish returns false (only) then the SCO can call: • LMSGetLastError • LMSGetErrorString • LMSGetDiagnositc 3. API Adapter State Transitions
4. API Error Code Usage • 0 • 101 • 201 • 202 • 203 • 301 • 401 • 402 • 403 • 403 • 405
API Adapter Find API 5. LMS Responsibility <SCRIPT LANGUAGE=JAVASCRIPT > var findAPITries = 0; function findAPI(win) { // Check to see if the window (win) contains the API // if the window (win) does not contain the API and // the window (win) has // a parent window and the parent window // is not the same as the window (win) while ( (win.API == null) && (win.parent != null) && (win.parent != win) ) { // increment the number of findAPITries findAPITries++; // Note: 7 is an arbitrary number, // but should be more than sufficient if (findAPITries > 7) { alert("Error finding API -- too deeply nested."); return null; } // set the variable that represents the window being // being searched to be the parent // of the current window // then search for the API again win = win.parent; } return win.API; } function getAPI() { // start by looking for the API in the current window var theAPI = findAPI(window); // if the API is null (could not be found in the current window) // and the current window has an opener window if ( (theAPI == null) && (window.opener != null) && (typeof(window.opener) != "undefined") ) { // try to find the API in the current window’s opener theAPI = findAPI(window.opener); } // if the API has not been found if (theAPI == null)