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.
    • CommentAuthorclewis13
    • CommentTimeAug 11th 2008
     
    Having issues with passing the session time and then closing the browser window. I have a function, closewindow, in the opening html that will close the parent window, but when I do this, the session time does not pass. If I comment out:

    ExternalInterface.call("closewindow");


    it passes the session time, but then I am left with an open browser window.

    In the code below, I am checking for "success" after sending the session time so I would figure it would not call the close window until after all is true. Any ideas?


    var success:Boolean = false;
    success = scorm.set("cmi.core.session_time", coursetimerSWF.timer_txt);
    if (success) {
    var success:Boolean = false;
    success = scorm.save();
    if (success) {
    var success:Boolean = false;
    success = scorm.disconnect()
    if (success) {
    var myurl:String="javascript:self.close()";
    var mywindow:String="self";
    ExternalInterface.call("closewindow",myurl,mywindow);
    //ExternalInterface.call("closewindow");
    }
    }
    } else {
    serverUnresponsive();
    }
    • CommentAuthorphilip
    • CommentTimeAug 11th 2008
     
    you shouldn't keep re-declaring "success"... you can re-use it without redeclaring it.


    var success:Boolean = scorm.set("cmi.core.session_time", coursetimerSWF.timer_txt);

    if (success) {

    success = scorm.save();

    if (success) {

    success = scorm.disconnect()

    if (success) {

    var myurl:String="javascript:self.close()";
    var mywindow:String="self";
    ExternalInterface.call("closewindow", myurl, mywindow);
    //ExternalInterface.call("closewindow");

    } else {
    //disconnect failed
    }

    } else {
    //save failed
    }

    } else {
    //set() failed
    serverUnresponsive();
    }


    As far as closing the window, I have a function I keep in my JavaScript named 'exit' that usually handles that stuff. Something along the lines of:


    function exit(){

    if(pipwerks.scorm.connection.isActive){

    var success = scorm.save();

    if(success){

    success = scorm.quit();

    if(success && window.opener){

    window.close();

    }

    }

    } else {

    if(window.opener){
    window.close();
    }
    }

    }


    Then I can just use a single ExternalInterface call like so:

    ExternalInterface.call("exit");


    The window.opener bit just ensures that I'm only trying to close a popup window; if it isn't a popup window, I leave it open.
    • CommentAuthorclewis13
    • CommentTimeAug 12th 2008
     
    Thanks. I couldn't figure out why it wasn't doing what expected, session time and then quitting, that is why I was resetting the success var.

    I like your solution better by placing the final save, etc. in the html and have incorporated that method and it appears to be working.
    • CommentAuthorclewis13
    • CommentTimeAug 12th 2008
     
    OK, I do have issue.

    When testing local, Reload Scorm PLayer and ADL Test Suite, the passing of session_time works fine. Reload updates the total_time based upon what is sent in session_time.

    When client tests on their LMS, Total LMS 7.2, the serverUnresponsive() function is called and the session_time is not passed.

    I am still Googling for any info, but if any one has suggestion I would appreciate them.
    • CommentAuthorphilip
    • CommentTimeAug 12th 2008
     
    The various LMS implementations of SCORM are always fun to work with. :confused:

    Sometimes it's the imsmanifest that causes the issue; I'd look through the manifest and see if there's anything funky going on.
    • CommentAuthorphilip
    • CommentTimeAug 12th 2008
     
    PS: try your manifest in the ADL test suite... there's a validation test for SCOs, but there's also validation a test for manifests.
    • CommentAuthorclewis13
    • CommentTimeAug 12th 2008
     
    I am not clear on how the manifest could impact the sending of session_time.

    Any explanation?
    • CommentAuthorphilip
    • CommentTimeAug 12th 2008
     
    i suggested checking the manifest because you mentioned you used Reload to create the manifest; at least one person has told me his Reload-generated manifest *didn't* work while a hand-coded one did. Go figure. :smile:

    you also mentioned SumTotal... sometimes there are settings that can be enabled/disabled using the manifest. for instance, i know in SumTotal the only way to hide the SumTotal course playback controller (i forget the exact name they give it) is using the SCORM manifest... you can't control it with any of your course code or with any settings in the course's SumTotal settings panel, you must use the manifest.

    in general, SCORM manifests affect *everything* and usually cause more problems than they're worth. :tongue:

    ok, so assuming your manifest is fine, what else could be causing your issue?

    well, session_time must be formatted in a strict string format: "HHHH:MM:SS". some people run into trouble because they aren't setting the leading zero properly in the 'hours' portion of the string. scorm.set() will return an error if the hours part of the string is less than two digits. see this previous discussion.


    Hours must be a minimum of 2 digits. if your time string doesn't have two digits for hours, you will get an error message from the LMS (205: incorrect data type). this would be an easy error to run into, since if you've only done one hour, a straight number-to-string conversion would give you 1:00:00 rather than 01:00:00.


    - philip
    • CommentAuthorclewis13
    • CommentTimeAug 12th 2008 edited
     
    I used Reload Scorm Player, not the manifest maker. I have heard similar things about it. I hand build mine.

    Yes, I have the nodes in the manifest to kill of the Sumtotal Player and that works fine.

    I think I may of discovered my problem while eating lunch...allowed brain to relax. It is with the format, but not the leading 0 for hours. My timer was tracking hh:mm:ss:ms and I was passing this value. Both ADL and Reload accepted this value. I guess they ignored the trailing "ms". I am ripping off the "ms" and will see if this works. I am thinking it will.
    • CommentAuthorclewis13
    • CommentTimeAug 12th 2008
     
    Update. Session time works. It was the trailing "ms" that threw off the LMS. Surprised it worked in local testing, but not LMS. Anywho...good news. Will be posting another question in another topic shortly.
    • CommentAuthorphilip
    • CommentTimeAug 12th 2008
     
    ahh... according to the docs, trailing milliseconds need to be separated by a period, not a semicolon, and must be limited to two digits:

    hh:mm:ss.mm

    Glad you got it sorted out. :smile:
    • CommentAuthorclewis13
    • CommentTimeAug 19th 2008
     
    Yes, read about MS needing to be separated by a period. Mine was using semicolon, which was the cause of the error. Actually surprised that you can pass MS. Who would want to track down to that level anyway. :-)