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

SCORM javascript redirect call incompatible with embedded SCORM activities

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.7
    • Fix Version/s: 3.1.4, 3.2.1
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide

      Please try to test this in as many supported browsers as possible!

      Standalone SCORM test:

      1. As an admin, Create a SCORM activity and make sure to set 'Display package' to 'New window'. You can use the attached package if you like
      2. As a student, open the SCORM activity. Confirm that it opens in a new window.
      3. Close the activity window. Confirm that the main window redirects to 'youursite/course/view.php?id=x#section-y'

      Embedded SCORM test:

      1. Set up LTI tool publishing (https://docs.moodle.org/32/en/Publish_as_LTI_tool)
      2. Create a SCORM activity in a course
      3. Now, from the course nav, select 'Published as LTI tools'
      4. Set a name, select your SCORM activity under 'tool to be published' and save.
      5. You should now see your published tool listed. We'll use the LTI 1 URL and Secret here.
      6. Now, create another moodle site (Site2). This will be the LTI consumer site.
      7. Create a course and create a new External Tool.
      8. Paste the LTI 1 tool URL from Site1 into the 'Tool URL' field.
      9. Click 'show more' and set 'Launch container' to 'Embed'
      10. Type any string into the consumer key field.
      11. Paste the secret from Site1 into the 'Shared secret' field.
      12. Save and view the external tool. Confirm that you see Site1 embedded within Site2.
      13. Enter the SCORM. Confirm that it opens in a new window
      14. Close the SCORM and Confirm that:
        • The embedded frame (Site1) is redirected back to the course view page for that site and course.
        • The URL of the window is still set to Site2 and you can still navigate around your site (i.e. you still have the nav and drawer, etc).
      15. Now, go back and edit the external tool
      16. Set the 'Launch container' to 'Embed without blocks' and save
      17. View the tool, Confirm that you don't see the nav, drawer, etc.
      18. Open the SCORM and Confirm that it opens in a new window
      19. Close the SCORM window and Confirm that:
        • The frame in the main window (Site1) has been redirected to the course/view page.
        • The URL of the main window is still set to Site2, but you can't navigate (no nav, drawer, etc).
      Show
      Please try to test this in as many supported browsers as possible! Standalone SCORM test: As an admin, Create a SCORM activity and make sure to set 'Display package' to 'New window'. You can use the attached package if you like As a student, open the SCORM activity. Confirm that it opens in a new window. Close the activity window. Confirm that the main window redirects to 'youursite/course/view.php?id=x#section-y' Embedded SCORM test: Set up LTI tool publishing ( https://docs.moodle.org/32/en/Publish_as_LTI_tool ) Create a SCORM activity in a course Now, from the course nav, select 'Published as LTI tools' Set a name, select your SCORM activity under 'tool to be published' and save. You should now see your published tool listed. We'll use the LTI 1 URL and Secret here. Now, create another moodle site (Site2). This will be the LTI consumer site. Create a course and create a new External Tool. Paste the LTI 1 tool URL from Site1 into the 'Tool URL' field. Click 'show more' and set 'Launch container' to 'Embed' Type any string into the consumer key field. Paste the secret from Site1 into the 'Shared secret' field. Save and view the external tool. Confirm that you see Site1 embedded within Site2. Enter the SCORM. Confirm that it opens in a new window Close the SCORM and Confirm that : The embedded frame (Site1) is redirected back to the course view page for that site and course. The URL of the window is still set to Site2 and you can still navigate around your site (i.e. you still have the nav and drawer, etc). Now, go back and edit the external tool Set the 'Launch container' to 'Embed without blocks' and save View the tool, Confirm that you don't see the nav, drawer, etc. Open the SCORM and Confirm that it opens in a new window Close the SCORM window and Confirm that : The frame in the main window (Site1) has been redirected to the course/view page. The URL of the main window is still set to Site2, but you can't navigate (no nav, drawer, etc).
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE, MOODLE_32_STABLE
    • Pull Master Branch:
      master_MDL-50643

      Description

      I have 2 Moodle instances, 1 is an LTI provider and 1 is an LTI consumer. The LTI provider shares a SCORM module. I added the SCORM module as an "External tool" activity. On the provider, the SCORM is set to open in a new window. The problem is that when the consumer closes the SCORM window, the parent consumer page gets redirected to the provider course's main page.

      I put the following fix:

      --- a/mod/scorm/view.js
      +++ b/mod/scorm/view.js
      @@ -47,7 +47,7 @@ M.mod_scormform.init = function(Y) {
               setTimeout(function() {
                   if (winobj.closed) {
                       // Redirect the parent window to the course homepage.
      -                parent.window.location = course_url;
      +                window.location = course_url;
                   }
               }, 800)
           }
      

      Works for me on chrome and IE, using either the LTI provider or consumer.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jan/17