Moodle
  1. Moodle
  2. MDL-21333

Popup blocker and alternative link: tracking doesn't work at all in some not so rare condition from a user perspective

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.10
    • Component/s: SCORM
    • Labels:
      None
    • Environment:
      LAMP, PHP 5.2.12
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      26969

      Description

      • Configure the activity to launch the course in popup
      • Launch the course/selected item
      • Close the item currently delivered to the user, everything being happily tracked
      • Click the link below, being written in the base page:

      "If a new window does not appear, click here to launch the activity"

      Using an AICC HACP based course (to be tested if it applies also with SCORM based courses) it silently breaks any tracking call since the status is "Terminated", on aicc.php side.
      While it is clear the aim of that link (possible solution against popup blockers) it adds a possible issue with the user experience.

      It's difficult to think at the right fix: a possible approach should be to hide that link using DHTML but when using AICC HACP based courses it's not "so easy" to create a proper server callback client side. The link could be also injected via DHTML if creating the popup will fail, giving the user the alternative link just when needed: this is just a mitigation since the user can always click on it after closing the popup.

      Anyone ever fall in such a situation?

        Activity

        Hide
        Matteo Scaramuccia added a comment -

        Find below our fix proposal, see also the usage of _blank instead of new:

        player.php:

        @@ -319,9 +319,9 @@
                             </iframe>
                             </noscript>
         <?php
        -            //Added incase javascript popups are blocked
        -            $link = '<a href="'.$CFG->wwwroot.'/mod/scorm/loadSCO.php?id='.$cm->id.$scoidstr.$modestr.'" target="new">'.get_string('popupblockedlinkname','scorm').'</a>';
        -            print_simple_box(get_string('popupblocked','scorm',$link),'center');
        +            // Added in case javascript popups are blocked
        +            $link = '<a href="'.$CFG->wwwroot.'/mod/scorm/loadSCO.php?id='.$cm->id.$scoidstr.$modestr.'" target="_blank">'.get_string('popupblockedlinkname','scorm').'</a>';
        +            print_simple_box(get_string('popupblocked','scorm',$link),'center','','',5,'generalbox','altpopuplink');
                 }
             } else {
                 print_simple_box(get_string('noprerequisites','scorm'),'center');
        

        loadSCO.php:

        @@ -176,7 +177,21 @@
                                                         }
                                                     }, 1000);
                     }
        +            removelink();
                 }
        +
        +        function removelink()
        +        {
        +            try {
        +                if (window.opener.document.getElementById('altpopuplink')) {
        +                    window.opener.document.getElementById('altpopuplink').style.display='none';
        +                } else {
        +                    window.opener.document.all['altpopuplink'].style.display='none';
        +                }
        +            } catch(error) {
        +                // nothing to be done
        +            }
        +        }
                 //]]>
                 </script>
                 <noscript>
        
        Show
        Matteo Scaramuccia added a comment - Find below our fix proposal, see also the usage of _blank instead of new : player.php : @@ -319,9 +319,9 @@ </iframe> </noscript> <?php - //Added incase javascript popups are blocked - $link = '<a href= "'.$CFG->wwwroot.'/mod/scorm/loadSCO.php?id='.$cm->id.$scoidstr.$modestr.'" target= " new " >'.get_string('popupblockedlinkname','scorm').'</a>'; - print_simple_box(get_string('popupblocked','scorm',$link),'center'); + // Added in case javascript popups are blocked + $link = '<a href= "'.$CFG->wwwroot.'/mod/scorm/loadSCO.php?id='.$cm->id.$scoidstr.$modestr.'" target= "_blank" >'.get_string('popupblockedlinkname','scorm').'</a>'; + print_simple_box(get_string('popupblocked','scorm',$link),'center','','',5,'generalbox','altpopuplink'); } } else { print_simple_box(get_string('noprerequisites','scorm'),'center'); loadSCO.php : @@ -176,7 +177,21 @@ } }, 1000); } + removelink(); } + + function removelink() + { + try { + if (window.opener.document.getElementById('altpopuplink')) { + window.opener.document.getElementById('altpopuplink').style.display='none'; + } else { + window.opener.document.all['altpopuplink'].style.display='none'; + } + } catch (error) { + // nothing to be done + } + } //]]> </script> <noscript>
        Hide
        Chad Outten added a comment -

        Yes - I have a client who has described this behaviour and I replicated it. Naturally, the 'Click here to launch activity' link is more a hinderance than help for end-users if SCORM communication is terminated and their progress is not recorded, tracked by Moodle.

        Show
        Chad Outten added a comment - Yes - I have a client who has described this behaviour and I replicated it. Naturally, the 'Click here to launch activity' link is more a hinderance than help for end-users if SCORM communication is terminated and their progress is not recorded, tracked by Moodle.
        Hide
        Dan Marsden added a comment -

        fix now in 1.9stable and HEAD - thanks for the report and fix!

        Show
        Dan Marsden added a comment - fix now in 1.9stable and HEAD - thanks for the report and fix!
        Hide
        Dan Marsden added a comment -

        hmmm - looks like this breaks for Google Chrome

        Google Chrome doesn't have a very "visible" notification that a pop-up has been blocked and the javascript runs and hides the "click here to launch activity"

        we might need to think about a better way to handle this... maybe just some text that states something like

        "This SCORM opens in a new window - if it didn't appear please disable your pop-up blocking tool and re-load this page"

        Show
        Dan Marsden added a comment - hmmm - looks like this breaks for Google Chrome Google Chrome doesn't have a very "visible" notification that a pop-up has been blocked and the javascript runs and hides the "click here to launch activity" we might need to think about a better way to handle this... maybe just some text that states something like "This SCORM opens in a new window - if it didn't appear please disable your pop-up blocking tool and re-load this page"
        Hide
        Dan Marsden added a comment -

        removed the link completely and changed the message that appears so that it will display. We could write a better detection script that checked if the pop-up was created and hid the message, but I don't think that's necessary.

        thanks!

        Show
        Dan Marsden added a comment - removed the link completely and changed the message that appears so that it will display. We could write a better detection script that checked if the pop-up was created and hid the message, but I don't think that's necessary. thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: