Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorPsaldorn
    • CommentTimeAug 6th 2008 edited
     
    Hi all,
    I just started to use to convert a standalone flash content module to be SCORMy (2004) and have had a little trouble.

    Using
    Flash: ExternalInterface.call("pipwerks.SCORM.API.get", "cmi.interactions._count")
    seems to return undefined, which causes carnage when adding a new interaction id etc. Just as part of general debugging I tried to call
    pipwerks.SCORM.API.get("cmi.interactions._count")
    in the FireBug console.. which results in the titular "pipwerks is undefined" error.

    When attempting to use teh API FireBug gives me:

    SCORM.API.find: API found.
    Version: 2004
    API: [object Object]


    So I presume the wrapper is there and functioning?

    Am I being ignorant of something? The wrapper appears in the FireBug->Scripts listing. I've used Reload editor to make my manifest, but it's only html, swf and wrapper at the minute.

    Oh, I'm using the testtrack.scorm.com site to test the SCO.

    Any ideas? Thanks in advance,
    Martin
    • CommentAuthorPsaldorn
    • CommentTimeAug 6th 2008
     
    Erm, I'll try with SCORM.data.get *whistles*
    • CommentAuthorPsaldorn
    • CommentTimeAug 6th 2008
     
    Ok that works, any idea why getting

    cmi.interactions.(_count value).correct_responses._count


    I recieve:

    SCORM.data.get(cmi.interactions.1.correct_responses._count) failed.
    Error code: 301
    Error info: General Get Failure


    Should it not return Null or 0 at least?
    • CommentAuthorphilip
    • CommentTimeAug 6th 2008
     
    Hi Martin

    It looks like you're rolling your own ExternalInterface code.

    I have ExternalInterface-based SCORM classes (one AS2 version and one AS3 version) that handles all of that for you:

    Documentation
    Simple tutorial

    It's pretty easy to use (in my opinion, anyway :bigsmile:).

    If you use the ActionScript class with your example, it would look like this in the FLA:


    import pipwerks.SCORM;

    var lmsConnected:Boolean;
    var scorm:SCORM = new SCORM();
    var count:Number;

    lmsConnected = scorm.connect();

    if(lmsConnected){

    //Be sure to explicitly convert the data type if you don't want a string
    count = Number(scorm.get("cmi.interactions.1.correct_responses._count"));

    } else {

    trace("Could not connect to LMS.");

    }


    The HTML file would simply need to be linked to pipwerks scorm wrapper, no extra JavaScript required.

    - philip
    • CommentAuthorPsaldorn
    • CommentTimeAug 7th 2008
     
    Cheers Philip, I would use the provided classes but.. well I feel like I'm not really learning what I'm doing then. Being my first foray into SCORM and having no client spec or LMS details (bespoke) I wanted to actually *know* if that makes sense? .. And I saw the links too late :)

    As far as I can tell the last problem (GetValue for cmi.interactions.1.correct_responses._count) should work and even if it fails, shouldn't be related to AS code, no?

    Correct_responses is empty at the time admittedly, but the docs say it should return 0. For now it's not an issue as I only have one numeric response that gets validated and it seems to accept it being entered (but does throw an error 0 "unknown error".

    You'd then expect the correct_response to be empty when looking at runtime object afterwards.. but no, my validation information is there. Somehow even though I can't be passing the cmi.interaction.n.correct_responses.X value, it's being entered as cmi.interaction.n.correct_responses.0.pattern.

    I'm currently pretending there isn't an issue, but I know as soon as people want 2 c_r values I'm in trouble :)

    While I have your attention [sorry], what is best practice for the end of an SCO? I'm looking into JS detection of frameset/child popup closure actioning (due to not knowing what the target LMS does and reusability), but do you think I should just leave it at the "thank you" screen? Doesn't seem friendly to me but.. *shrugs*

    If you ever find yourself in Sheffield, UK feel free to contact me for your 3 free beers/ciders/whatevers (JS wrapper, helpful articles, current help). Trying to figure out "what to do" from a zero start and the ADL website is.. well. You helped a lot :D
    • CommentAuthorPsaldorn
    • CommentTimeAug 7th 2008 edited
     
    On further looking

    Checking for GetValue Error
    SCORM ERROR FOUND - Set Error State: 301 - The Interactions collection
    does not have an element at index 4, the current element count is 4.


    Calling it just before I've actually put anything in the latest interactions slot. D'oh!

    I owe you yet more favours for first linking me to testtrack.scorm.com, I find ADL's RTE totally useless.
    • CommentAuthorphilip
    • CommentTimeAug 7th 2008
     
    Hi Martin

    RE: end of SCOs, I'm not sure what you're asking, but here's how I generally handle things:

    1. When the final page loads (or when a final action is taken, such as completing a quiz), my course script immediately sets the course status to "completed" (or failed if needed).

    2. Once the lesson status is set (and "score.raw" if needed), I immediately kill the LMS connection. This eliminates the possibility of accidentally overwriting the completion status.

    3. There is usually some kind of verbiage on the screen informing the user that it's now safe to close the window. I never automatically close it, because I give people the ability to go back and review content. This may not work for everyone.


    Additional thoughts:

    If someone closes the course window prematurely, you need to ensure that their status/bookmark is saved. Most browsers will do this with window.onunload, but Internet Explorer (you know, our 'special' friend) should also have window.onbeforeunload set to execute the same script as window.unload.

    Regarding having the ability to review content in a completed course, you need to ensure a couple of things are set:

    1. exit needs to be set to either logout (SCORM 1.2) or normal (SCORM 2004). This ensures the LMS knows that the course is not supposed to be retaken. The pipwerks SCORM wrapper handles this automatically based on the value of lesson status. (This feature can be disabled if you don't want to use it... just set pipwerks.SCORM.handleCompletionStatus = false; ).

    2. In the course's startup/init code, be sure to check for a completion as soon as you've established a connection, but before doing any other LMS actions. This ensures that if a course has been completed (or passed), the LMS connection can be killed and the content can be viewed without tracking progress.

    The downside of this approach is that it won't work with SCORM's sequencing and navigation feature (LMS connection must be active to handle navigation), but that's OK because nobody uses it anyway. :)

    - philip

    PS: My brother just took a tour of Old Trafford about 2 weeks ago. That's pretty close to you from the looks of it. :)