Uploaded image for project: '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
    • Status: Closed
    • Priority: 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 Master Branch:
      master_MDL-36421

      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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            danmarsden 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
            danmarsden 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
            danmarsden Dan Marsden added a comment -

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

            Show
            danmarsden Dan Marsden added a comment - just tested this on 2.4 - still a problem there - works fine in FF, fails in IE
            Hide
            benrj 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
            benrj 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
            benrj Ben Johnson added a comment -

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

            Show
            benrj Ben Johnson added a comment - Patch file to go with BRJ comment on 1/4/13
            Hide
            matteo 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 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
            danmarsden 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
            danmarsden 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
            poltawski 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
            poltawski 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
            poltawski Dan Poltawski added a comment -

            Integrated to master, 24 and 23. Thanks Dan!

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

            This is working great.

            Tested in IE and FF for 2.3, 2.4 and master

            Test passed.

            Show
            rwijaya Rossiani Wijaya added a comment - This is working great. Tested in IE and FF for 2.3, 2.4 and master Test passed.
            Hide
            stronk7 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
            stronk7 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:
                  Fix Release Date:
                  11/Mar/13