eLBX Online 2021 | June 22 - 24


Join us for a FREE, 3-day virtual conference featuring industry experts and eLearning thought leaders. Learn about critical topics such as eLearning accessibility, learning experience design, course authoring, virtual reality, and gamification. Register today!
CHECK IT OUT

Workaround for the non-working Exit button (as defined in Lectora) for Edge or Chrome browsers?

timsantoro
timsantoro Community Member Posts: 1 ☆ Roadie ☆
Anyone know of a workaround for the non-working Exit button (as defined in Lectora) for Edge or Chrome browsers? Our LMS opens the course in a new window, therefore the Javascript to close the course window will not work due to the new security built into Chrome and Edge. Since the course window was not opened using Javascript, the close function is deemed malicious. Thanks in advance for any solutions that you can help define here.
Tagged:

Answers

  • wheels
    wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 553 eLearning ROCKSTAR Admin Team
    What I have seen some customers do in the past is to run another action after the exit action and show an initially hidden text block with a background that covers the screen.

    The text block would have some text like this: "Your progress has been saved and it is safe to close this browser window."
  • carlfink
    carlfink Community Member Posts: 879 ♦ Idol ♦
    What @wheels suggests is exactly what we do, again precisely because the Exit button does not work reliably or on every platform.
  • vicki
    vicki Community Member Posts: 75 ♪ Opening Act ♪
    Hi @timsantoro What we have done for several years now is replace the Lectora scofunctions2004 file that is created when the course is published in scorm with a customized copy. I will need to see if it is okay to share the file.
  • vicki
    vicki Community Member Posts: 75 ♪ Opening Act ♪
    From my LMS manager regarding the scofunctions2004 customization. I don't understand most of what she said, but the fix works in Moodle:

    To close the window, we are really just changing one function.

    function doQuit(bForce){
    computeTime();
    saveVariable( 'TrivantisEPS', 'T' );

    //LMSSetValue( 'adl.nav.request', 'exit' ;
    var result;
    result = LMSCommit();
    finishCalled = true;
    result = LMSFinish();
    saveVariable( 'TrivantisSCORMTimer', 0 );
    //if( bForce && window.myTop ) window.myTop.close()
    window.myTop.close();

    }

    As to the adl.nav.request, that may not matter to others. Since we don’t have multiple scos in a single scorm, this has caused issues in the past, so we just comment it out to prevent any errors.

    The main thing is the commenting out the “if (bForce….” line and just always calling the window.myTop.close(). I still don’t know what that “bForce” variable is, but it never seems to be passed into the function and the window won’t close without it. So, we ditch the if statement and just close the window anyways.
  • wheels
    wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 553 eLearning ROCKSTAR Admin Team
    The bForce variable is set to true when you publish with the publish option The published course will be presented in a separate window than the LMS is checked. We are planning to remove that publish option and always default it. We should always "try" to close the window, the browser will not let us if it's in the same window as the LMS anyway.
  • web-foley
    web-foley Community Member Posts: 55 ✶ Headliner ✶
    edited May 20, 2021
    We were unable to use (anymore) the "initially hidden text block with a background that covers the screen" as it didn't meet Accessibility standards (it's not a proper modal dialog, they can be tricky as they're a bugger to control focus, I've never been able to make one with Lectora yet https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/dialog.html). I believe our LMS has an open window waiting for our course window to close.
  • carlfink
    carlfink Community Member Posts: 879 ♦ Idol ♦
    web-foley said:

    ... it's not a proper modal dialog, they can be tricky as they're a bugger to control focus, I've never been able to make one with Lectora yet ...

    I know little about Aria, but in Lectora courses that needed a real dialog, I have always ended up having to work around Lectora itself and just write simple JavaScript code to open a system dialog. It's one of the very easiest things to do in JS--I'm far from skilled in that language. If you needed something like support for multiple language, of course, it would get significantly harder.
Sign In or Register to comment.

So You Wanna Be An eLearning ROCKSTAR?

We're all fans of eLearning here! Want to become an eLearning ROCKSTAR? Just click on one of the buttons below to start your rocking journey!