Search code examples
javascriptactionscript-3flashscorm

Improper flash package


I have a SCORM package made of couples of swfs and the player. However when user start the content from LMS the player is initialised improperly or broken and of course it does not work and function as it is supposed to be. There is a console log of the package that may give an idea.

Synchronous XMLHttpRequest on the main thread is deprecated because of its   detrimental effects to the end user's experience. For more help, check     

http://xhr.spec.whatwg.org/.
Initializing SCORM class...ExternalInterface.available evaluates true.     
SCORM.isAvailable() evaluates true. SCORM class file check, ready.
SCORM.connect() called from class file
connection.initialize called.
SCORM.API.find: API found. Version: 2004
API: [object Object]
SCORM.data.get(cmi.completion_status)  value: unknown
__connectionActive: true
SCORM.data.get(cmi.location) failed. 
Error code: 403
Error info: hata
SCORM.data.get(cmi.location)  value: 
SCORM.get(cmi.location) failed. 
Error code: 403
Error info: hata
public function get returned: 
SCORM.data.get(cmi.entry)  value: ab-initio
public function get returned: ab-initio
SCORM.data.get(cmi.location) failed. 
Error code: 403
Error info: hata
SCORM.data.get(cmi.location)  value: 
SCORM.get(cmi.location) failed. 
Error code: 403
Error info: hata
public function get returned: 
SCORM.data.get(cmi.learner_name)  value: test test
public function get returned: test test

Solution

  • The log indicates the course starts up correctly. The "error" is actually correct behavior: requesting the bookmark (cmi.location) will result in an error if the course is ab-initio (a first launch). There is no bookmark because it hasn't been created yet.

    If you are expecting the course to have a bookmark -- i.e. you are relaunching the course and it still behaves as if it's ab-initio -- I would guess you are not properly using Commit (scorm.save() in this wrapper) after posting the data to the LMS, and/or are not issuing a Terminate (scorm.quit in this wrapper) before closing the course.

    Update based on comment below

    If your course checks cmi.entry and sees ab-initio, no need to look for a bookmark. You should use a conditional statement to prevent errors and reduce the chatter between the LMS and course:

    var bookmark = "my default";
    var entry = scorm.get("cmi.entry");
    var location; //wait for it...
    
    if(entry !== "ab-initio"){
    
        //not querying cmi.location unless we're sure this isn't the first visit
        location = scorm.get("cmi.location");
    
        //Wrapping in a conditional in case cmi.location returns false or an empty string
        if(location){ bookmark = location; }
    
    }
    
    courseFunctionThatUsesBookmarkValue(bookmark);