Moodle
  1. Moodle
  2. MDL-33755

Enable direct launch of scorm activities from the course overview page

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide

      Create a SCORM package in your course and test with the following settings - enter each SCORM as a student.
      This must be tested against Multiple browsers with pop-up blockers turned off.

      1. Test 1
        Use the following settings:
        • Display package: New Window
        • Student skip content structure: Always
          Make sure popup is generated, and parent window returns to couse/view.php (all one step)
      2. Test 2
        Use the following settings:
        • Display package: New Window
        • Student skip content structure: First Access
          On first entry only it should open popup, and return parent window to couse/view.php on second entry it should display scorm/view.php to student to allow entry, then when entering course it should launch pop-up and return parent window to course/view.php
      1. Test 3
        Use the following settings:
        • Display package: New Window
        • Student skip content structure: Never
          On entry it should load mod/scorm/view.php, click enter to open pop-up and parent window should return to course/view.php

      Re-test using the same settings in a course using the SCORM course format (ignore redirect error when using SCORM course see MDL-28583)

      Show
      Create a SCORM package in your course and test with the following settings - enter each SCORM as a student. This must be tested against Multiple browsers with pop-up blockers turned off. Test 1 Use the following settings: Display package: New Window Student skip content structure: Always Make sure popup is generated, and parent window returns to couse/view.php (all one step) Test 2 Use the following settings: Display package: New Window Student skip content structure: First Access On first entry only it should open popup, and return parent window to couse/view.php on second entry it should display scorm/view.php to student to allow entry, then when entering course it should launch pop-up and return parent window to course/view.php Test 3 Use the following settings: Display package: New Window Student skip content structure: Never On entry it should load mod/scorm/view.php, click enter to open pop-up and parent window should return to course/view.php Re-test using the same settings in a course using the SCORM course format (ignore redirect error when using SCORM course see MDL-28583 )
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull Master Branch:
      master_MDL-33755
    • Rank:
      41789

      Description

      Redirect SCORM View page back to homepage on launch of SCORM in pop-up

        Issue Links

          Activity

          Hide
          Piers Harding added a comment -

          I've committed a single fix to a separate branch https://github.com/piersharding/moodle/tree/MDL-33755 that uses JavaScript to send the parent window back to the course overview screen after the SCORM activity has been launched.

          The behaviour is controlled by the following options:

          Display package: New Window
          Student skip content structure: Always

          Always jump from course/view.php -> open popup, and return parent window to couse/view.php (all one step)

          Display package: New Window
          Student skip content structure: First Access

          On first attempt only Jump from course/view.php -> open popup, and return parent window to couse/view.php (all one step)
          On subsequent attempts go from course/view.php -> mod/scorm/view.php - click enter and open popup, and return parent window to course/view.php

          Display package: New Window
          Student skip content structure: Never
          On all attempts go from course/view.php -> mod/scorm/view.php - click enter and open popup, and return parent window to course/view.php

          Cheers,
          Piers Harding.

          Show
          Piers Harding added a comment - I've committed a single fix to a separate branch https://github.com/piersharding/moodle/tree/MDL-33755 that uses JavaScript to send the parent window back to the course overview screen after the SCORM activity has been launched. The behaviour is controlled by the following options: Display package: New Window Student skip content structure: Always Always jump from course/view.php -> open popup, and return parent window to couse/view.php (all one step) Display package: New Window Student skip content structure: First Access On first attempt only Jump from course/view.php -> open popup, and return parent window to couse/view.php (all one step) On subsequent attempts go from course/view.php -> mod/scorm/view.php - click enter and open popup, and return parent window to course/view.php Display package: New Window Student skip content structure: Never On all attempts go from course/view.php -> mod/scorm/view.php - click enter and open popup, and return parent window to course/view.php Cheers, Piers Harding.
          Hide
          Dan Marsden added a comment -

          rebased Piers patch - thanks Piers

          Show
          Dan Marsden added a comment - rebased Piers patch - thanks Piers
          Hide
          Ankit Agarwal added a comment -

          Hi Dan,
          The patch looks good, but I couldn't test it as there are a few conflicts. Can you please resolve those and repush?
          Thanks

          Show
          Ankit Agarwal added a comment - Hi Dan, The patch looks good, but I couldn't test it as there are a few conflicts. Can you please resolve those and repush? Thanks
          Hide
          Dan Marsden added a comment -

          thanks - rebased.

          Show
          Dan Marsden added a comment - thanks - rebased.
          Hide
          Ankit Agarwal added a comment -

          Hi Guys a few things:-,
          Test 1 :-

          1. After I have configured the scorm, each time someone visits the scorm it redirects them back to course/view.php , which makes it impossible for teachers/admins to change any setting for the scorm any further as they are always redirected back to course/view.php .
          2. Redirect is breaking in chrmoium
          3. Redirect is breaking in opera.
          4. Didnt test on IE

          Thanks

          Show
          Ankit Agarwal added a comment - Hi Guys a few things:-, Test 1 :- After I have configured the scorm, each time someone visits the scorm it redirects them back to course/view.php , which makes it impossible for teachers/admins to change any setting for the scorm any further as they are always redirected back to course/view.php . Redirect is breaking in chrmoium Redirect is breaking in opera. Didnt test on IE Thanks
          Hide
          Dan Marsden added a comment -

          thanks Ankit - re Test 1.1 Are you sure you aren't logged in as a teacher that has been added as a student to the course? - skipcontentview should only take place when the user is logged in as a student. I've been wanting to change this though as teachers can still edit the scorm using the editing icons on the course/view.php - but there's no current way to access the reports page without seeing the content structure page.
          I've just checked Test 1.1 and it works as expected for teachers - I'll update the test instructions to make sure that's clear.

          redirect breaking in chromium/opera sounds like a bug though. I'll take a look at that too.

          Show
          Dan Marsden added a comment - thanks Ankit - re Test 1.1 Are you sure you aren't logged in as a teacher that has been added as a student to the course? - skipcontentview should only take place when the user is logged in as a student. I've been wanting to change this though as teachers can still edit the scorm using the editing icons on the course/view.php - but there's no current way to access the reports page without seeing the content structure page. I've just checked Test 1.1 and it works as expected for teachers - I'll update the test instructions to make sure that's clear. redirect breaking in chromium/opera sounds like a bug though. I'll take a look at that too.
          Hide
          Ankit Agarwal added a comment -

          Hi Dan,
          I tried again with three users:-
          Admin enrolled as student
          Admin not enrolled in course
          User enrolled as teacher in the course

          Redirect is happening for all three.
          Thanks

          Show
          Ankit Agarwal added a comment - Hi Dan, I tried again with three users:- Admin enrolled as student Admin not enrolled in course User enrolled as teacher in the course Redirect is happening for all three. Thanks
          Hide
          Dan Marsden added a comment -

          cool - found the issue with the redirect for teachers/admins, have just pushed a fix that should address that - looking at chromium/opera next.

          Show
          Dan Marsden added a comment - cool - found the issue with the redirect for teachers/admins, have just pushed a fix that should address that - looking at chromium/opera next.
          Hide
          Dan Marsden added a comment -

          I'm not sure the redirect student issue you're seeing is specific to chromium/opera.

          when not using skipview - redirect works fine in chromium.

          when using skipview in all browsers and logged in as student the player.php page is shown with the message "click here to return to course page" in the parent window. It works correctly when logged in as admin/teacher.

          Show
          Dan Marsden added a comment - I'm not sure the redirect student issue you're seeing is specific to chromium/opera. when not using skipview - redirect works fine in chromium. when using skipview in all browsers and logged in as student the player.php page is shown with the message "click here to return to course page" in the parent window. It works correctly when logged in as admin/teacher.
          Hide
          Ankit Agarwal added a comment -

          Yup you are right. It is also happening in ff.

          Show
          Ankit Agarwal added a comment - Yup you are right. It is also happening in ff.
          Hide
          Dan Marsden added a comment -

          have updated the code to make it work as expected for students. and removed some stuff from being rendered in the initial parent window before redirect. - Ankit would you mind taking another look?

          Show
          Dan Marsden added a comment - have updated the code to make it work as expected for students. and removed some stuff from being rendered in the initial parent window before redirect. - Ankit would you mind taking another look?
          Hide
          Ankit Agarwal added a comment -

          Looks good now. Logged in as admin/teacher I was shown the overview page (with no popup). Once I clicked on preview/normal the scorm was loaded in a popup and I was taken to course/view.php. As student I was redirected back straight away with the popup.

          Feel free to submit for integration.
          Thanks

          Show
          Ankit Agarwal added a comment - Looks good now. Logged in as admin/teacher I was shown the overview page (with no popup). Once I clicked on preview/normal the scorm was loaded in a popup and I was taken to course/view.php. As student I was redirected back straight away with the popup. Feel free to submit for integration. Thanks
          Hide
          Dan Marsden added a comment -

          cool - thanks, I'll wait until next week as this patch conflicts with a stable patch so it is probably easier for integrators to delay until that has landed.

          Show
          Dan Marsden added a comment - cool - thanks, I'll wait until next week as this patch conflicts with a stable patch so it is probably easier for integrators to delay until that has landed.
          Hide
          Dan Marsden added a comment -

          changed my mind - have merged this patch on top of MDL-34755 and found it needed a bit more work - have shifted the course_url/launch_url higher into the var defs and tidied it up a bit - Ankit any chance you could review one last time before I submit for integration? - thanks!

          Show
          Dan Marsden added a comment - changed my mind - have merged this patch on top of MDL-34755 and found it needed a bit more work - have shifted the course_url/launch_url higher into the var defs and tidied it up a bit - Ankit any chance you could review one last time before I submit for integration? - thanks!
          Hide
          Ankit Agarwal added a comment -

          Looks good.
          Thanks

          Show
          Ankit Agarwal added a comment - Looks good. Thanks
          Hide
          Dan Marsden added a comment -

          NOTE TO INTEGRATOR: MDL-34755 is included in this patch - it must be integrated first.

          Show
          Dan Marsden added a comment - NOTE TO INTEGRATOR: MDL-34755 is included in this patch - it must be integrated first.
          Hide
          Eloy Lafuente (stronk7) 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
          Eloy Lafuente (stronk7) 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
          Sam Hemelryk added a comment -

          Thanks Dan, integrated now.

          Show
          Sam Hemelryk added a comment - Thanks Dan, integrated now.
          Hide
          Rossiani Wijaya added a comment -

          Hi Dan,

          I noticed the following error while testing:

          Notice: Undefined variable: scoes in /master/mod/scorm/view.php on line 73
          
          Notice: Trying to get property of non-object in /master/mod/scorm/view.php on line 73
          

          Failing test. Sorry.

          Show
          Rossiani Wijaya added a comment - Hi Dan, I noticed the following error while testing: Notice: Undefined variable: scoes in /master/mod/scorm/view.php on line 73 Notice: Trying to get property of non-object in /master/mod/scorm/view.php on line 73 Failing test. Sorry.
          Hide
          Dan Marsden added a comment -

          Thanks Rosie that's great, I obviously didnt test that with a fresh user, will be an easy fix, will push one through when I get back to the office in approx 3 hrs

          Show
          Dan Marsden added a comment - Thanks Rosie that's great, I obviously didnt test that with a fresh user, will be an easy fix, will push one through when I get back to the office in approx 3 hrs
          Hide
          Dan Marsden added a comment -

          looking at that code again there's more work that needed to be done - using scorm_get_tracks in those checks (which it did in old code before this patch) is pretty nasty. Also I noticed magic numbers when constants should be used so there are 2 new commits on the branch - one to fix magic numbers and the other to use a quicker/cleaner function that checks to see if the user has any data/tracks before skipping the content structure view - thanks Rosie for testing - hopefully this will sort it.

          Show
          Dan Marsden added a comment - looking at that code again there's more work that needed to be done - using scorm_get_tracks in those checks (which it did in old code before this patch) is pretty nasty. Also I noticed magic numbers when constants should be used so there are 2 new commits on the branch - one to fix magic numbers and the other to use a quicker/cleaner function that checks to see if the user has any data/tracks before skipping the content structure view - thanks Rosie for testing - hopefully this will sort it.
          Hide
          Ankit Agarwal added a comment -

          Hi Dan,
          array('userid'=>$userid, 'scormid'=>$scormid), needs spaces between the => operators to comply with our coding styles

          Thanks

          Show
          Ankit Agarwal added a comment - Hi Dan, array('userid'=>$userid, 'scormid'=>$scormid), needs spaces between the => operators to comply with our coding styles Thanks
          Hide
          Dan Marsden added a comment -

          doh - good spotting! - I also found a bug with the way skipview works when using "first time" and logged in as a student - it was opening an extra pop-up incorrectly. code updated - thanks Ankit

          Show
          Dan Marsden added a comment - doh - good spotting! - I also found a bug with the way skipview works when using "first time" and logged in as a student - it was opening an extra pop-up incorrectly. code updated - thanks Ankit
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Changes look ok. Applied and putting this back under testing. Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Changes look ok. Applied and putting this back under testing. Thanks!
          Hide
          Rossiani Wijaya added a comment -

          Hi Dan,

          For test instruction #1 (as student), selecting the scorm activity produces 2 popup windows (the scorm package and a message window with the following description 'If you have finished viewing this resource, click here to return to the course page').

          It should only display 1 popup window, correct?

          Show
          Rossiani Wijaya added a comment - Hi Dan, For test instruction #1 (as student), selecting the scorm activity produces 2 popup windows (the scorm package and a message window with the following description 'If you have finished viewing this resource, click here to return to the course page'). It should only display 1 popup window, correct?
          Hide
          Rossiani Wijaya added a comment -

          This is working great after clearing the cache.

          Thank you Dan.

          Test passed.

          Show
          Rossiani Wijaya added a comment - This is working great after clearing the cache. Thank you Dan. Test passed.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Gutta cavat lapidem, non vi sed saepe cadendo - Ovidio

          This issue has been integrated upstream and is now available both via git and cvs (and in some hours, via mirrors and downloads).

          Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Gutta cavat lapidem, non vi sed saepe cadendo - Ovidio This issue has been integrated upstream and is now available both via git and cvs (and in some hours, via mirrors and downloads). Thanks!

            People

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

              Dates

              • Created:
                Updated:
                Resolved: