Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Exit button and project end option "exit" not working

Explorer ,
Apr 06, 2017 Apr 06, 2017

I created several modules and have an issue with the exit button and the exit at end of project option is not working in Firefox and Chrome but works in Explorer.

Any ideas

392
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Apr 06, 2017 Apr 06, 2017
LATEST

You need to override CP's exit function.

I use this code for a SCORM 2004 course. This code needs to be loaded after the CPM.js file is loaded to work. If you put this in the head of the html (for HTML5 output only) it will exit correctly. I wrote this to stop the entire browser from closing in the LMS in IE, it's been tested in every browser and tablets.

var netConnected = location.protocol.indexOf( 'http' );

var localHost = location.href.indexOf( 'localhost' );

window.addEventListener( 'moduleReadyEvent', function ( e )

{

interfaceObj = e.Data;

eventEmitterObj = interfaceObj.getEventEmitter();

    initializeEventListeners();

//override Captivates exit function, fix for IE closing browser

window.DoCPExit = function()

{

  if ( netConnected != -1 && localHost == -1 )//only execute if running on the server

  {

   SCORM2004_CallSetValue( 'adl.nav.request', 'suspendAll' );

   SCORM2004_CallSetValue( 'cmi.exit', 'suspend' );

   var result = SCORM2004_CallTerminate();

  

   if ( result )

   {

    document.location.href = 'goodbye.html';

   }

  }

  else

  {

   var win = window.open( '', '_top', '', 'true' );

         win.opener = true;

         win.close();

  }

}

});

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources