SCORM API discovery and FireFox

Scorm RSS Icon ATOM Icon 2009/12/22 19:14 visualp

Overview

SCORM content interoperability depends on the ability of SCORM content objects to discover a SCORM API instance provided by the LMS in a related frame of window. Sometimes the discovery algorithm fails in FireFox because of an unexpected side effect of the FireFox scripting security implementation. This can happens if a SCO is launched in a mixed window or frame environment in which the discovery algorithm stumbles on a window with content from another domain. This document describes an improved API discovery scripting technique that prevents this problem without compromising functionality or security.

The generic API discovery script

The basic SCORM API discovery algorithm is well specified in IEEE 1484.11.2 and in the SCORM Runtime Environment book. The same ECMAScript algorithm works for SCORM 2004 and SCORM 1.2, except for the fact that the name of the API object is different. In SCORM 1.2 the object is named "API" and in SCORM 2004 it is named "API_1484_11". In the rest of this document, we will assume SCORM 2004. While there have been proposals for "improvements" to the algorithm as it is implemented in the informative script samples provided in the IEEE standard and the SCORM document, such improvements do not modify the basic algorithm.

The algorithm searches the window context in which the SCO has been launched. If first looks at the parents, if any, of the frame in which the SCO might have been launched. If it does not find the API object there, it looks at the opener of the window in which the SCO has been launched and up its parent chain. This works very well most of the time. However, in some rare and obscure circumstances, the generic script will fail in the FireFox browser.

The failure case

The conditions under which the generic script fails are

  • The browser is FireFox, and
  • The search algorithm stumbles upon a window that displays content from another domain before it finds the window that contains the API object.

When both conditions are met, the Firefox script fails silently and completely. The FireFox JavaScript console shows an uncaught exception because "Window.API_1484_11" is not allowed. This is not displayed as a typical JavaScript error with a line number. Close inspection of the code shows that this happens when the window that is being inspected displays content from a different domain. Instead of returning null when the existence of a non-existent property of the "foreign" window is checked, FireFox triggers a fatal script exception. While this makes sense as a way to discourage "probing" cross-scripting exploits, it also makes life more difficult for legitimate content objects that can dynamically adapt to different environments.

This is an obscure bug, and one that can be difficult to even recognize or diagnose. The conditions where the search algorithm might encounter a "foreign" window are probably extremely rare in e-Learning environments. But people are showing more interest in using SCORM content in environments that are richer than the traditional CBT and that may gather content and resources from various sources. This might be through embedding in portals or simulations, or by mixing and matching resources in a Web 2.0 "mash-up". Also, SCOs are sometimes designed so that they can be used with or without a LMS, maybe for performance support or demonstration purposes. This FireFox "feature" and its effect on a SCO was actually discovered in the context of such a demonstration. In that demonstration, no LMS was expected. Initialization of some other features of the SCO failed as FireFox stopped script execution while the SCO was attempting to check whether a SCORM API was available. This bug was discovered by inspecting web server logs and wondering why another file which the SCO references in a normal run was never being loaded.

The fix

The fix for this problem, at the ECMAScript level, is quite simple but still requires some careful coding to avoid introducing new bugs. Basically, it consists of using a try/catch control structure when testing a window for presence of the API object. This in turn requires adding some complexity to the algorithm, as in the example below.

Consider the following generic discovery script:

var gAPI = null; // Stand-in for the API object, if found.

function _ScanForAPI(win)
{
  // This function is called by GetAPI
  var nFindAPITries = 500;
  while ((win.API_1484_11 == null)&&
         (win.parent != null)&&(win.parent != win))
  {
    nFindAPITries--;
    if (nFindAPITries < 0) return null;
    win = win.parent;
  }
  return win.API_1484_11;
}

function GetAPI(win)
{
  // Sets gAPI to be a reference to the API object provided by the RTE,
  // or leave it as null if no API object could be found.
  // Parameter win is the SCO's window
  if ((win.parent != null) && (win.parent != win))
  {
    gAPI = _ScanForAPI(win.parent);
  }
  if ((gAPI == null) && (win.opener != null))
  {
    gAPI = _ScanForAPI(win.opener);
  }
}

FireFox fails in the _ScanForAPI function when it is asked to evaluate win.API_1484_11 if doing so leads to an uncaught security exception. There is a risk of failure if any of the window.xxx calls touches a "foreign" window. So, the fix involves catching and handling the exception if it occurs, as follows:

var gAPI = null; // Stand-in for the API object, if found.

function _ScanForAPI(win) // Revised to handle x-scripting errors
{
  // This function is called by GetAPI
  var nFindAPITries = 500; // paranoid to prevent runaway
  var objAPI = null;
  var bOK = true;
  var wndParent = null;
  while ((!objAPI)&&(bOK)&&(nFindAPITries>0))
  {
    nFindAPITries--;
    try { objAPI = win.API_1484_11; } catch (e) { bOK = false; }
    if ((!objAPI)&&(bOK))
    {
      try { wndParent = win.parent; } catch (e) { bOK = false; }
      if ((!bOK)||(!wndParent)||(wndParent==win))
      {
        break;
      }
      win = wndParent;
    }
  }
  return objAPI;
}

function GetAPI(win) // Revised to handle x-scripting errors
{
  // Sets gAPI to be a reference to the API object provided by the RTE,
  // or leave it as null if no API object could be found.
  // Parameter win is the SCO's window
  var wndParent = null;
  var wndOpener = null;
  try { wndParent = win.parent; } catch(e) { }
  try { wndOpener = win.opener; } catch(e) { }
  if ((wndParent != null) && (wndParent != win))
  {
    gAPI = _ScanForAPI(wndParent);
  }
  if ((gAPI == null) && (wndOpener != null))
  {
    gAPI = _ScanForAPI(wndOpener);
  }
}

And that is all there is to it. For SCORM 1.2, just substitute "API" for "API_1484_11".

Design notes: The structure of the new functions is obviously more complex, to ensure a clean break in case an exception gets triggered by cross-scripting restrictions when a "foreign" window is inspected. I considered replacing "(win.API_1484_11)" in the original function with a call to a function that would do the testing with try/catch, e.g. something like "(testForAPI(win))" but then I realized that for all we know FireFox might also add an uncaught exception for "(win.parent)" even if it does not seem to do it now. The revision above does not depend on another function, and it never encounters the "win.parent" situation even if it were to become invalid, because it stops testing the window as soon as an error is detected in "win.API_1484_11". This is "defensive" scripting.

Discussion

This solution does impose some constraints. However those constraints should not be an issue for most deployments.

  • If any "foreign" window is encountered while walking the windows, the discovery script will not search beyond that window in the window hierarchy that is being inspected. However, I could not come up with any realistic scenario where this would cause a problem, or with a robust solution to "skip over" a window if the browser decides that the window is not accessible due to cross-scripting restrictions.
  • This solution only works with "modern" browsers that implement the try/catch feature of ECMAScript. This should not be a problem since, for security reasons, older browsers should not be deployed in a real world situation. It might however be an issue with some assistive technology browsers that use a more primitive JavaScript engine.

If it is not possible to fix up the SCOs or to use up to date browsers, the infrastructure-level workaround is always available. It consists of drawing the SCORM content, the LMS and any other content used in the same browser context from the same server, or rather from what appears to the browser as being a single server, even if they actually come from different origin servers. This is typically done through the use of a reverse proxy.

Where it is not possible to fix up existing SCOs, another workaround is through the use of "wrapper SCO" that plays the SCO in a frame, and that contains a relay API object that is initialized by an error-handling discovery script. The actual SCO's discovery script will find this relay API first and stop there, never causing an error.

Conclusion

This is an obscure bug that has the potential for causing various levels of grief and mysterious failures. I would recommend to not worry overly about it when dealing with existing content unless the bug already causes problem. However, new content should use an updated, defensive discovery scripting approach to prevent uncaught script exceptions.

This scripting strategy allows a SCO to run anywhere without risk that the initialization scripts will be rudely stopped. Even if the script is stopped silently, there is usually more initialization to be done after discovering whether or not an API is available.

2009/12/22 19:14 2009/12/22 19:14
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/170

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/170

스콤 정리 자료[pdf]

Scorm RSS Icon ATOM Icon 2009/12/18 12:03 visualp
http://140.105.152.133/mod/resource/index.php?id=5

스콤에 대한 전반적인 내용들이 정리 되어 있음
2009/12/18 12:03 2009/12/18 12:03
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/164

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/164

scorm: SCORM Sequencing & Navigation

Scorm RSS Icon ATOM Icon 2009/12/18 11:06 visualp

Here are the elements used for SCORM 2004 S&N. These elements go in the imsmanifest.xml file.

The SCORM 2004 books are all PDF files. Personally I am not a fan of PDFs so here is an overview pulled from SCORM_CAM.pdf. In addition google may be able to index this blog post a little better than the PDF.

The main element used for sequencing in the imsmanifest is the <sequencing> element.

The <sequencing> element will usually appear as a child of your <item> elements. (If you didn’t already know, the <item> elements can also be thought of as the Learning Activities.) There should be zero or one <sequencing> element per <item> element.

Here are a couple of excerpts from SCORM_CAM.pdf.

“Sequencing information is associated with items in a hierarchical structure by associating a single <sequencing> element with the hierarchical item. In the context of IMS Content Packages, this is done by including the <sequencing> element within either an <item> element or an <organization> element. “

“Multiplicity: Occurs 1 or More times within the <sequencingCollection> element, if the <sequencingCollection> element is present. Occurs 0 or 1 time for each <item> or <organization> within an IMS content package.”

The children elements of the <sequencing> element are:

<controlMode>
Optional, “parent” element, can be used zero or one time. This element is “the container for the sequencing control mode information including descriptions of the types of sequencing behaviors specified for an activity. This element captures information dealing with the types of sequencing requests that are permitted.”
Attributes:
choice (optional, default value = true)
choiceExit (optional, default value = true)
flow (optional, default value = false)
forwardOnly (optional, default value = false)
useCurrentAttemptObjectiveInfo (optional, default value = true)
useCurrentAttemptProgressInfo (optional, default value = true)

<sequencingRules> ***
Optional, “parent” element, can be used zero or more times. This element is “the container for a sequencing rule description. Each rule describes the sequencing behavior for an activity. Each activity may have an unlimited number of sequencing rules and within any grouping the rules are evaluated in the order in which they are listed.”
Children:
<preConditionRule>
<exitConditionRule>
<postConditionRule>

<limitConditions>
Optional, “parent” element, can be used zero or one time. The ADL recommends this element be used with caution! “ADL supports the usage of only two current limit conditions. The limit condition deals with attempts on the activity and maximum time allowed in the attempt.”
Attributes:
attemptLimit (optional, default value = 0)
attemptAbsoluteDurationLimit (optional, default value = 0.0)

<auxiliaryResources>
The ADL recommends this element be used with caution! There is no additional information for this element.

<rollupRules> ***
Optional, “parent” element, can be used zero or one time. This element is “the container for the set of rollup rules defined for the activity.”
Attributes:
rollupObjectiveSatisfied (optional, default value = true)
rollupProgressCompletion (optional, default value = true)
objectiveMeasureWeight(optional, default value = 1.0000)
Elements:
<rollupRule>

<objectives> ***
Optional, “parent” element, can be used zero or one time. “Optional element, can be used zero or more times. This is a parent element. ”
Elements:
<primaryObjective>
<objective>

<randomizationControls>
Optional, “parent” element, can be used zero or one time. This element is “the container for the descriptions of how children of an activity should be ordered during the sequence process.”
Attributes:
randomizationTiming (optional, default = never)
selectCount (optional, default value = 0)
reorderChildren (optional, default value = false)
selectionTiming (optional, default = never)

<deliveryControls>
Optional, “parent” element, can be used zero or one time. This element is “is the container for the descriptions of how children of an activity should be ordered during the sequence process.”
Attributes:
tracked (optional, default value = true)
completionSetByContent (optional, default value = false)
objectiveSetByContent (optional, default value = false)

<adlseq:constrainedChoiceConsiderations>
Optional, “parent” element, can be used zero or one time. This element is “the container for the descriptions of how choice navigation requests should be constrained during the sequencing process. The constrained choice only applies to the activity for which it is defined.”
Attributes:
preventActivation (optional, default value = false)
constrainChoice (optional, default value = false)

<adlseq:rollupConsiderations>
Optional, “parent” element, can be used zero or one time. This element is “the container for the descriptions of when an activity should be included in the rollup process.”
Attributes:
requiredForSatisfied (optional, default value = always)
requiredForNotSatisfied (optional, default value = always)
requiredForCompleted (optional, default value = always)
requiredForIncomplete (optional, default value = always)
measureSatisfactionIfActive (optional, default value = false)

2009/12/18 11:06 2009/12/18 11:06
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/163

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/163

[스콤 교육] 2

Scorm RSS Icon ATOM Icon 2009/12/17 12:16 visualp
- submenifest --> item 내부의 아이템만 링크를 허용 한다.

- 메타데이터 활용 <-- 스코어 검색

- SCORM Metadata
  general(title , keyword, description) <-- 검색에유용 함.
 (특별한 경우 없으면, 필요한 것만 사용 하자 ...);

- onUnload , onBeforeunload 로대쳐 하여 사용 하자..(ie6종료 오류)

 - completion_status <-- 학습 완료에 대해서
- completion_threshold <-- 기준값
- Entry <-- 1.2 Eo .. 종료시 학습한 종료 위치를 저장 한 후 컨텐츠 시작시.. 불러서 그 위치로
                이동한다.

- 정보가 스코어 단위로 기록 된다.

- 시간은 초단위로 관리 한다.

-시퀀싱 엔진 (인증 ) 위해서는 넣기 ..(실제로 사용하는 경우는 거의 사용하지 않음)

C:\ADL\SCORM_2004_4th_Ed_Sample_RTE_V1.1.1\Sample_RTE\source\src\org\adl
datamodel, validator, samplerte,
정보 통신 산업 진흥원 가서 소스 찾아 보기 ....


ROLLUP(자식 노드에서 부모노드에 영항을........)
for Child Activity set <-- 자식들의 조건에 의해서 엑션을 취함
condition                                      Action
Any                                             satisfied
None                                         Not satisfied
At Least Count                           completed
At least pecent                          inComplete
 
rollupObjectiveSatisfied="false" <-- 보통 롤업 룰이 false 로 되어 있고,
Sequencing tree <-- 학습창 (시퀀싱 정보에 의해서 activity tree 를 구성 한다.)

Control Mode
트리가 존재 할 떄 트리들의 흐름을 제어 한다.
Control Choice (선택)
Control Choice exit (선택한게 끝났을 때 다른것을 선택 할 수 있음)
Contorl Flow  p/c (previews/continues)
Control Forwrd only

choice -->true 면 flow --> false가 되야함.
기본 defult--> choice="true" choiceExit="true" choiceExit="true" flow="true" forwardOnly="false"

choiceExit <-- 선택하여 컨텐츠 종류후 이동이 불가능 하다.
2009/12/17 12:16 2009/12/17 12:16
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/162

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/162

[스콤교육]정리2

Scorm RSS Icon ATOM Icon 2009/12/17 11:11 visualp

submeni

2009/12/17 11:11 2009/12/17 11:11
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/161

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/161

javascript RTE- API EXAMPLE

Scorm RSS Icon ATOM Icon 2009/12/15 16:51 visualp



javascript CMI -DATA EXAMPLE

스콤  RTE에서는 한글 언어셋 지원이 안됨으로 , 주의 할것 ...
2009/12/15 16:51 2009/12/15 16:51
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/160

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/160

[ 스콤교육 ] - 정리

Scorm RSS Icon ATOM Icon 2009/12/15 12:23 visualp

강의 지원 사이트
http://moodle.modulestudy.com

참고사이트
http://ide.ed.psu.edu

학습데이터 저장 공간 확보
학생들이 학습한 로그 정보 (발생시 등록 <-- 무들에서는 이렇게 처리)

CMI<-- API를 활용 하여 Sserver와 통신 후  저장 된 데이터를 활용하여 컨텐츠에 대한
전반 적인 분석에 활용 한다.

CMI.interaction <-- 학습자의 문제 풀이 정보 분석에 활용.

CMI.totaltime  <-- 학습자의 전체 학습 시간 분석 ,, 스코어별 학습 시간 분석.

개발시 유의 사항
메타 데이터 사용 할 것만 정의 하여 사용 한다.
시퀀싱 자체 제작 또는 템플릿을 활용 한다.

LMS는 키워드 검색 정도까지만 범위를 두어서 개발 ...
kEM 2.0 --> 컨버터를 이용하여 LOM  방식으로 변환

ADL OBJECTIVES ADL SCORM RTE 4th Edition

CMI.DATA.MODEL == > RTE.DATA.MODEL 변경

Keris   추천 API  를 사용 하자 ..
Ostynscomtime.js <-- 스콤에서 시간 표현 관련 api

Entry -  학습 횟수 판단,, 처음 학습 했는지 또는 몇 번째 학습 인지에 대해서 판단 한다.

Location <--  사용자의 마지막 학습 위치를 찾기; <--entry 값과 비교하여 resume  값 일 경우
예전에 수행했던 곳으로 이동 한다. (Location 에 저장 되어 있음);

SAMPLE RTE -- 중단(suspend) -  사용자의 요청으로 중단 되는 상황, 현제 진행 중인 데이터가  DB에 남아 있음

                   --종료(Quite) - 사용자의 종료 요청 ... 다음에 종료 했던 컨텐츠를 다시 실행 했을 때 처음 부터 다시 시작 한다.
               
                  -- bookmark기능을 활용 하면  location  객체에 즐겨 찾기 식으로 등록 되어 있음.


                 -- Completion Threshold (진도율 체크;
                    패키징 과정에서 지정 해야함.
                    1.3 0.5 (50%)
                    control false 로 반드시 지정 해야함.
                   1을 기준으로 계산 하며, 스코어 별로 진도율을 체크 하기 위해서는
                    패키징 과정에서 설정을 해줘야 한다.
                   RTE 4 Edition  에서는

                   (weight*실제 progress) / (모든 weight  값을 더한 값) ;
                   이 값을 기준으로 masure값과 비교 하여 complete 여부를 판단한다.

                Rollup -> 진도율이 롤업 됨,

               CMI 데이터를 기준으로 하여 다음 진행 해야될 컨텐츠에 대해서 시퀀싱 하는데
                기준자료로 활용 될 수 있다.(스킵 및 재 학습에 활용 된다. );
             
 masure 와 progress masure 에대허서 비교 하여 정리 하기
               ROll UP에 대해서 더 공부 ....(필수);;
            
               -- action script 를 통해서 프로그래스 바 의 진행 상황을 java script  와 통신 하여
                   CMIapi와 통신 하여 ... 처리 한다.
                  기준 데이터는 메니페스트 파일에 정의 되어 있음.

        시퀀싱 엔진 --> local 시퀀싱 방식 , 웹 서비스 방식... 처리.
        ilias.de <-- 일리어스 스콤 php 전용 LMS
        icodeon.com <-- 스콤 2004 기반 LMS
       
      Success <-- 점수와 관련 ;
      Complete <-- 진도율;
      이수율,성취율 체크 독립된 SCO단위로 적용이 가능 하며, 시퀀싱 네비게이션시 메타데이터와 참조 되어 진행 된다.
 
     --interactions(상호작용)
         시간 체크, lantency(진행 시간) , timeStemp(진행 할 시간), type(시간 유형)
        SessionTime Duration(얼마동안 진행 했는지?) duration type으로 한다.

SCORM RTE 4 TH , CAM 관련 문서 ... 참고 할 것
CMI쪽 패키징 쪽과 관련 하여 .. 컨텐츠 구조를 분석 하여 적용 한다.

Sequencing  할때 처리 방법 : flash,silvelight,ajax 등 활용 하여 처리

RUSTICI<- 스콤에 관여...사이트 가서 방문자료 참조....
http://scorm.zendesk.com/portal

cmi.completeion_threshold - 0-1 값
스코어 완료시 (complete / unknown );
 
성취여부 - passed

MetaData <-- 스코어 벼롤 메타 데이터가 생성되며,
General
   
Life Cycle
metametadata
Technical
Educational
Rights
Relation
Annotation

Interrativity Type 상호작용성 정도
Leaming Resource 

Intended End User Role
Context
Typical Age Range
Difficulty
Typical Leaming Time
Description
Language

메타 데이터는 XML 통체로 넣고 .. 파싱 ?
(MERLOT.ORG <-- 컨텐츠 저장소)
CODRA 프로젝트 ..<-- SCORM  기반 컨텐츠 들을 중앙 집중식 공용 저장소에 저장 한 후 검색에 활용하여 컨텐츠를 검색시 유용 하게 하기 위해서 ...
오픈 아이디와 비슷??

메타 데이터  <-- 메니페스트 파일에 포함 될 수도 있으며,  외부 파일로 존재 할 수 도 있다.-->
kem2.0에서는 외부 파일로 존재 한다.

시퀀싱

2009/12/15 12:23 2009/12/15 12:23
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/159

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/159

사용자 삽입 이미지
2009/12/10 21:46 2009/12/10 21:46
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/157

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/157

사용자 삽입 이미지
2009/12/10 21:45 2009/12/10 21:45
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/156

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/156

사용자 삽입 이미지
2009/11/11 10:42 2009/11/11 10:42
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/144

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/144