Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-34755

SCORM won't open in new window for IE7 and IE8 in compatibility mode

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3.3
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a SCORM activity
      2. Set display package to "New Window"
      3. View the activity in IE8 (compatibility mode off)
      4. Click "Enter" - activity will open in a new window (as expected)
      5. Turn on IE8 compatibility mode
      6. Click "Enter" - activity will open in the current window (not expected)
        Please re-test in Other browsers too - esp FF/Chrome
        (NOTE TO TESTER: pop-ups in 2.3 are dumb... MDL-33755 has a planned improvement)
      Show
      Create a SCORM activity Set display package to "New Window" View the activity in IE8 (compatibility mode off) Click "Enter" - activity will open in a new window (as expected) Turn on IE8 compatibility mode Click "Enter" - activity will open in the current window (not expected) Please re-test in Other browsers too - esp FF/Chrome (NOTE TO TESTER: pop-ups in 2.3 are dumb... MDL-33755 has a planned improvement)
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
      master_MDL-34755

      Description

      Due to some odd behaviour in old versions of IE, the JS that binds the onsubmit code fails in IE7 and IE8 in compatibility mode.

      To reproduce:

      1. Create a SCORM activity
      2. Set display package to "New Window"
      3. View the activity in IE8 (compatibility mode off)
      4. Click "Enter" - activity will open in a new window (as expected)
      5. Turn on IE8 compatibility mode
      6. Click "Enter" - activity will open in the current window (not expected)

      For more details see:

      http://stackoverflow.com/questions/95731/why-does-an-onclick-property-set-with-setattribute-fail-to-work-in-ie/
      http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx

      The problem line is in mod/scorm/view.js L18.

      Initially I tried using the YUI Events library to bind the onsubmit event, thinking that it would abstract away any differences but that didn't seem to work for me.

      What did work was to change from using YUI:

      var scormform = Y.one('#scormviewform');

      to plain javascript:

      var scormform = document.getElementById('scormviewform');

      and then replacing the setAttribute call:

      scormform.setAttribute('onsubmit', "window.open('','Popup','"poptions"'); this.target='Popup';");

      with:

      scormform.onsubmit = function()

      {window.open('', 'Popup', poptions); this.target='Popup';}

      ;

      that fixed it for me in IE while it still works in Firefox, Chrome and IE8 with compatibility off.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    12/Nov/12