Moodle
  1. Moodle
  2. MDL-36421

SCO package opens in same frame when set to open in new window and SCORM course format used

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.3.5, 2.4.2
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide

      create a new course using the SCORM course format
      Add a scorm to the course and set it to display in a new window.
      enter the SCORM - it should open in a new window (not in the same frame)
      pop-up blockers may interfere so make sure they are disabled.
      Also - there are a few bugs/issues with redirects/new windows so before failing this or reporting other issues please check open issues. - thanks.

      Show
      create a new course using the SCORM course format Add a scorm to the course and set it to display in a new window. enter the SCORM - it should open in a new window (not in the same frame) pop-up blockers may interfere so make sure they are disabled. Also - there are a few bugs/issues with redirects/new windows so before failing this or reporting other issues please check open issues. - thanks.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull 2.4 Branch:
      m24_MDL-36421
    • Pull Master Branch:
      master_MDL-36421
    • Rank:
      45246

      Description

      I have a course that is using the SCORM format. I have added a sco and set this to open in a new window. From the course page, when a user enters the sco, it appears in the same frame not the new window I wanted.

      I have tried this on a different site and used other sco packages and get the same result.

        Activity

        Hide
        Dan Marsden added a comment -

        thanks for the report - we did make a few more improvements to that stuff in 2.4 so it might operate differently in 2.4 than 2.3

        Show
        Dan Marsden added a comment - thanks for the report - we did make a few more improvements to that stuff in 2.4 so it might operate differently in 2.4 than 2.3
        Hide
        Dan Marsden added a comment -

        just tested this on 2.4 - still a problem there - works fine in FF, fails in IE

        Show
        Dan Marsden added a comment - just tested this on 2.4 - still a problem there - works fine in FF, fails in IE
        Hide
        Ben Johnson added a comment - - edited

        Here's the patch we've made in our 2.4 codebase. We haven't tested it extensively yet, but will likely be pushing it out to our 10,000+ user instance in the next few weeks:

        Index: locallib.php
        ===================================================================
        --- locallib.php	(revision 9510)
        +++ locallib.php	(working copy)
        @@ -840,7 +840,7 @@
         }
         
         function scorm_view_display ($user, $scorm, $action, $cm) {
        -    global $CFG, $DB, $PAGE, $OUTPUT;
        +    global $CFG, $DB, $PAGE, $OUTPUT, $COURSE;
         
             if ($scorm->scormtype != SCORM_TYPE_LOCAL && $scorm->updatefreq == SCORM_UPDATE_EVERYTIME) {
                 scorm_parse($scorm, false);
        @@ -919,8 +919,8 @@
                               <label for="a"><?php print_string('newattempt', 'scorm') ?></label>
                     <?php
                 }
        -        if (!empty($scorm->popup)) {
        -            echo '<input type="hidden" name="display" value="popup" />'."\n";
        +        if ($COURSE->format != 'scorm' && (!empty($scorm->popup))) {
        +            echo '<input type="hidden" name="display" value="popup" />'."\n";
                 }
                 ?>
        
        Show
        Ben Johnson added a comment - - edited Here's the patch we've made in our 2.4 codebase. We haven't tested it extensively yet, but will likely be pushing it out to our 10,000+ user instance in the next few weeks: Index: locallib.php =================================================================== --- locallib.php (revision 9510) +++ locallib.php (working copy) @@ -840,7 +840,7 @@ } function scorm_view_display ($user, $scorm, $action, $cm) { - global $CFG, $DB, $PAGE, $OUTPUT; + global $CFG, $DB, $PAGE, $OUTPUT, $COURSE; if ($scorm->scormtype != SCORM_TYPE_LOCAL && $scorm->updatefreq == SCORM_UPDATE_EVERYTIME) { scorm_parse($scorm, false ); @@ -919,8 +919,8 @@ <label for = "a" ><?php print_string('newattempt', 'scorm') ?></label> <?php } - if (!empty($scorm->popup)) { - echo '<input type= "hidden" name= "display" value= "popup" />'. "\n" ; + if ($COURSE->format != 'scorm' && (!empty($scorm->popup))) { + echo '<input type= "hidden" name= "display" value= "popup" />'. "\n" ; } ?>
        Hide
        Ben Johnson added a comment -

        Patch file to go with BRJ comment on 1/4/13

        Show
        Ben Johnson added a comment - Patch file to go with BRJ comment on 1/4/13
        Hide
        Matteo Scaramuccia added a comment -

        Hi Ben,
        the tags for code are:

        {code}
        code goes here
        {code}

        You can use the {noformat} tag as well: more in https://tracker.moodle.org/secure/WikiRendererHelpAction.jspa?section=advanced .

        HTH,
        Matteo

        Show
        Matteo Scaramuccia added a comment - Hi Ben, the tags for code are: { code } code goes here { code } You can use the { noformat } tag as well: more in https://tracker.moodle.org/secure/WikiRendererHelpAction.jspa?section=advanced . HTH, Matteo
        Hide
        Dan Marsden added a comment -

        that looks like a good interim solution - I'm hoping to refactor a lot of that code and replace the scorm course format with Marina's singleactivity course format in Moodle 2.5 which will make this a lot simpler.

        Show
        Dan Marsden added a comment - that looks like a good interim solution - I'm hoping to refactor a lot of that code and replace the scorm course format with Marina's singleactivity course format in Moodle 2.5 which will make this a lot simpler.
        Hide
        Dan Poltawski added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Dan Poltawski added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Dan Poltawski added a comment -

        Integrated to master, 24 and 23. Thanks Dan!

        Show
        Dan Poltawski added a comment - Integrated to master, 24 and 23. Thanks Dan!
        Hide
        Rossiani Wijaya added a comment -

        This is working great.

        Tested in IE and FF for 2.3, 2.4 and master

        Test passed.

        Show
        Rossiani Wijaya added a comment - This is working great. Tested in IE and FF for 2.3, 2.4 and master Test passed.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Surely you will be happy to know that your code is now part of Moodle upstream. Thanks, thanks!

        Closing as fixed, ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Surely you will be happy to know that your code is now part of Moodle upstream. Thanks, thanks! Closing as fixed, ciao

          People

          • Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: