Moodle
  1. Moodle
  2. MDL-37844

SCORM pre-req doesn't highlight currently selected node

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4, 2.5
    • Fix Version/s: 2.4.4
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide
      1. Download this zip:
        http://scorm.com/wp-content/assets/golf_examples/PIFS/AllGolfExamples.zip
      2. Extract the file "SequencingSimpleRemediation_SCORM20043rdEdition.zip"
      3. Add this SCORM package to your course
      4. Enter the SCORM package
      5. click on various SCO's in the toc "laying the Game, Etiquette, Handicapping etc"
      6. each click make sure the JS error mentioned in the description doesn't show
      7. Each click make sure the item(currently selected) in the TOC is highlighted after clicking.
      8. open a new tab in your browser and select it (doesn't matter what the content is)
      9. Switch back to the SCORM window and make sure the item in the toc is still highlighted.
      Show
      Download this zip: http://scorm.com/wp-content/assets/golf_examples/PIFS/AllGolfExamples.zip Extract the file "SequencingSimpleRemediation_SCORM20043rdEdition.zip" Add this SCORM package to your course Enter the SCORM package click on various SCO's in the toc "laying the Game, Etiquette, Handicapping etc" each click make sure the JS error mentioned in the description doesn't show Each click make sure the item(currently selected) in the TOC is highlighted after clicking. open a new tab in your browser and select it (doesn't matter what the content is) Switch back to the SCORM window and make sure the item in the toc is still highlighted.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull 2.4 Branch:
      m24_MDL-37844
    • Pull Master Branch:
      master_MDL-37844
    • Rank:
      47591

      Description

      This Js error occurs when navigating through a SCORM for example when selecting an item in the toc.
      Error: TypeError: scorm_layout_widget.getUnitByPosition is not a function
      Source File: mod/scorm/loaddatamodel.php?a=448&scoid=2991&currentorg=&attempt=1
      Line: 219

      because scorm_layout_widget isn't defined properly

      also:
      left.expanded should be left.expand (also mentioned in MDL-35840) - when an item in the sco is selected it should be highlighted in the toc.

      When moving the window focus (by viewing another tab in your browser window) and returning to the SCORM window the highlighted item in the toc is lost.

        Issue Links

          Activity

          Hide
          Dan Marsden added a comment -

          NOTE TO INTEGRATOR: Master and 24Stable only please - previous versions of the code are quite different.

          Show
          Dan Marsden added a comment - NOTE TO INTEGRATOR: Master and 24Stable only please - previous versions of the code are quite different.
          Hide
          Matteo Scaramuccia added a comment -

          Hi Dan,
          what about taking https://github.com/scara/moodle/commit/00927454f53f57bcbf076c216cb6dbd719a722fd from MDL-35840 to set the focus even when the main window get the focus (Test: Attend the SCORM, quickly check another program e.g. Skype, return to the SCORM)?

          Show
          Matteo Scaramuccia added a comment - Hi Dan, what about taking https://github.com/scara/moodle/commit/00927454f53f57bcbf076c216cb6dbd719a722fd from MDL-35840 to set the focus even when the main window get the focus (Test: Attend the SCORM, quickly check another program e.g. Skype, return to the SCORM)?
          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 Marsden added a comment -

          Thanks Matteo - yes that should have been included too, I've rebased, included that patch and updated the description and testing instructions with that patch - thaks!

          Show
          Dan Marsden added a comment - Thanks Matteo - yes that should have been included too, I've rebased, included that patch and updated the description and testing instructions with that patch - thaks!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated (24 & master), thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated (24 & master), thanks!
          Hide
          Adrian Greeve added a comment -

          Everything worked fine on master, but on my version of 2.4 I got a lot of errors. The main ones being.

          ERROR - Could not establish a connection with the LMS.
          
          Your results may not be recorded.
          
          "NetworkError: 404 Not Found - http://adrian.moodle.local/integration_24_postgres/pluginfile.php/48/mod_scorm/content/1/undefined"
          
          SyntaxError: missing ; before statement
          [Break On This Error] 	
          
          Notice: Undefined property: stdClass::$allowapidebug in /home/adrian/moodles/i
          

          I know this isn't the error mentioned in the issues title, but it stopped any highlighting of the various SCO's in the toc.

          Show
          Adrian Greeve added a comment - Everything worked fine on master, but on my version of 2.4 I got a lot of errors. The main ones being. ERROR - Could not establish a connection with the LMS. Your results may not be recorded. "NetworkError: 404 Not Found - http: //adrian.moodle.local/integration_24_postgres/pluginfile.php/48/mod_scorm/content/1/undefined" SyntaxError: missing ; before statement [Break On This Error] Notice: Undefined property: stdClass::$allowapidebug in /home/adrian/moodles/i I know this isn't the error mentioned in the issues title, but it stopped any highlighting of the various SCO's in the toc.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          ping!

          Show
          Eloy Lafuente (stronk7) added a comment - ping!
          Hide
          Dan Marsden added a comment -

          that is pretty low in quality for a failure report.... no line numbers, full debug info is not there, no information on when the errors occurred. also seems strange as this code doesn't touch allowapidebug so I'd suspect the test install is bad or the cache is screwed. could you please use a fresh 24 install and make sure your 2.4 install isn't corrupt somehow.

          Show
          Dan Marsden added a comment - that is pretty low in quality for a failure report.... no line numbers, full debug info is not there, no information on when the errors occurred. also seems strange as this code doesn't touch allowapidebug so I'd suspect the test install is bad or the cache is screwed. could you please use a fresh 24 install and make sure your 2.4 install isn't corrupt somehow.
          Hide
          Adrian Greeve added a comment -

          The screenshot provided shows the javascript errors when loading a scorm package with a fresh install.

          After talking with Ankit and enabling debugging, this issue went away. It seems that once debugging in SCORM has been activated then accessing SCORM packages works from that point on.

          Show
          Adrian Greeve added a comment - The screenshot provided shows the javascript errors when loading a scorm package with a fresh install. After talking with Ankit and enabling debugging, this issue went away. It seems that once debugging in SCORM has been activated then accessing SCORM packages works from that point on.
          Hide
          Dan Marsden added a comment -

          thanks Adrian - the screenshot is much more useful - it shows the js error is causing the "could not establish a link with LMS" error which would then in turn cause other errors to occur. it shows that a PHP error is occurring in the js code (line 258 col 18) - if you open that JS file directly it would probably show the full detail of the PHP error inline in the JS file.

          allowapidebug comes from a call to get_config('scorm'); and is set in admin -> plugins -> activities -> SCORM
          for it to not be set and return an undefined property error suggests a bug with cache of config vars or a bug with the saving of allowapidebug on your install at some point.

          If you can reproduce a situation on a normal install where allowapidebug is not set and then not available from a call to get_config('scorm') causing the undefined property error to occur please create a new bug as this is unrelated to this patch.

          opening the page "admin -> plugins -> activities -> SCORM" and saving should populate the allowapidebug setting correctly - it shouldn't matter if it is ticked or unticked - there should still be a value stored in the config table with 0 or 1 - if upgrade scripts are run correctly afaik it should never end up as null?

          as the issue reported by Adrian is unrelated to this patch this should pass (as long it tests correctly after resolving the allowapidebug issue by re-saving the settings page)

          Show
          Dan Marsden added a comment - thanks Adrian - the screenshot is much more useful - it shows the js error is causing the "could not establish a link with LMS" error which would then in turn cause other errors to occur. it shows that a PHP error is occurring in the js code (line 258 col 18) - if you open that JS file directly it would probably show the full detail of the PHP error inline in the JS file. allowapidebug comes from a call to get_config('scorm'); and is set in admin -> plugins -> activities -> SCORM for it to not be set and return an undefined property error suggests a bug with cache of config vars or a bug with the saving of allowapidebug on your install at some point. If you can reproduce a situation on a normal install where allowapidebug is not set and then not available from a call to get_config('scorm') causing the undefined property error to occur please create a new bug as this is unrelated to this patch. opening the page "admin -> plugins -> activities -> SCORM" and saving should populate the allowapidebug setting correctly - it shouldn't matter if it is ticked or unticked - there should still be a value stored in the config table with 0 or 1 - if upgrade scripts are run correctly afaik it should never end up as null? as the issue reported by Adrian is unrelated to this patch this should pass (as long it tests correctly after resolving the allowapidebug issue by re-saving the settings page)
          Hide
          Adrian Greeve added a comment -

          After initial problems, I can verify that this patch works.
          Test passed.

          Show
          Adrian Greeve added a comment - After initial problems, I can verify that this patch works. Test passed.
          Hide
          Dan Poltawski added a comment -

          Blooming Marvelous! It's time for a knees up - your changes are upstream!

          Thanks for making Moodle better!

          Toodle pip

          Show
          Dan Poltawski added a comment - Blooming Marvelous! It's time for a knees up - your changes are upstream! Thanks for making Moodle better! Toodle pip

            People

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

              Dates

              • Created:
                Updated:
                Resolved: