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

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 Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 665 eLearning ROCKSTAR Admin TeamWhat 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." -
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.
-
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 Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 665 eLearning ROCKSTAR Admin TeamThe 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.
-
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.
-
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.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 ...
-
wheels Florida USACommunity Member, Administrator, Moderator, Rockstar Manager Posts: 665 eLearning ROCKSTAR Admin Team@davidcm it looks like to topic of this thread mutated. What issue, exactly, did you run into? If it is that the Lectora close button is not closing the browser here are the two solutions:
When you publish your course, make sure the publish option The published course will be presented in a separate window than the LMS is checked.
... then if it is still not working ...
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."
-
Thanks for the quick response, @wheels. I published a course to AICC and the Exit button (on mouse click exit/close) didn't close the main course window in Chrome, although it did work in Firefox. The same button that was inherited in sub-windows (Help window and Glossary window) did work.
Unfortunately, the first option - launching the course in a separate window - didn't solve the problem.
With regards to the second option, is it possible to navigate to the window close button entirely by keyboard?
-
-
@davidcm, Lectora buttons are using the JavaScript engine in the browser "under the hood". JavaScript cannot close the main browser window, as a security measure. It can only close windows that were opened with JavaScript. That means that a course launched in a separate window can close itself, but not the main browser window. If a course is not launched in its own window, it just cannot close itself.
-
@davidcm, @wheels and @carlfink: I'm using L21.0.3 and the issue is still persisting when I published the title as HTML. I tried these 2 methods and I still can't get it to close: 1) standard close/exit action; 2) added a 2nd action On Mouse Click – Go To – Web Address - javascript: top.window.close() Delay before action: 2.0 seconds.
How do I exit the online course? Thanks for any tip! -
@davidcm, @wheels and @carlfink: I'm using L21.0.3 and the issue is still persisting when I published the title as HTML. I tried these 3 methods and I still can't get it to close: 1) standard close/exit action; 2) added a 2nd action On Mouse Click – Go To – Web Address - javascript: top.window.close() Delay before action: 2.0 seconds; 3) added keyboard shortcut. None of these worked with me and the text block is not an option for us because of accessibility.
Is there another workaround to exit the online course? Thanks for any tip!
Categories
- 35.8K All Categories
- 108 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 28.9K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 22 ELB Learning Content
- 22 ELB Learning Content Discussions
- 321 CenarioVR®
- 188 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 41 Rockstar Learning Platform®
- 38 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 5 The Training Arcade®
- 5 The Training Arcade Discussions
- 934 All Things eLearning
- 36 eLearning Development
- 546 Learning Management System (LMS) Integration
- 332 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products