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

SCORM - implement better sorting of scos

    Details

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

      This can only be tested by someone who has access to view database tables.
      NOTE: the scorm packages provided here aren't very good and should only be used for testing the structure order of the scos - not for general user data etc.

      First Add "tu95bear.zip" as a new SCORM package to your course and take a look at the structure order of the scos so you know what you should expect.

      Next Add tu95bear_small.zip as a new SCORM package to your course. (not replacing the above package)
      Take a look at the database table

      {scorm_scoes} and look the id field of each of the scos added. (remember these somehow). This SCORM package has a smaller set of SCOS and misses the one titled "the fastest propeller driven..."

      Then update this"tu95bear_small.zip" SCORM package replacing it with the package "tu95bear.zip" and make sure the order of scos shown is the same as the first package you added earlier - the new sco "the fastest propeller driven" should not appear at the end of the list but in the same place as earlier.

      Then check the database table - the records in the {scorm_scoes}

      table for scos that existed in the tu95bear_small.zip should have the same id numbers as before and the new sco should be added at the end of the table somewhere (prior to this patch on every update to a SCORM pacakge the records in scorm_scoes would be deleted and recreated generating new ids for each record)

      The scorm_scoes table is the only one that updates with this patch - other tables will have data deleted and recreated.

      hopefully that makes sense - ping Dan M if you need help.

      Show
      This can only be tested by someone who has access to view database tables. NOTE: the scorm packages provided here aren't very good and should only be used for testing the structure order of the scos - not for general user data etc. First Add "tu95bear.zip" as a new SCORM package to your course and take a look at the structure order of the scos so you know what you should expect. Next Add tu95bear_small.zip as a new SCORM package to your course. (not replacing the above package) Take a look at the database table {scorm_scoes} and look the id field of each of the scos added. (remember these somehow). This SCORM package has a smaller set of SCOS and misses the one titled "the fastest propeller driven..." Then update this"tu95bear_small.zip" SCORM package replacing it with the package "tu95bear.zip" and make sure the order of scos shown is the same as the first package you added earlier - the new sco "the fastest propeller driven" should not appear at the end of the list but in the same place as earlier. Then check the database table - the records in the {scorm_scoes} table for scos that existed in the tu95bear_small.zip should have the same id numbers as before and the new sco should be added at the end of the table somewhere (prior to this patch on every update to a SCORM pacakge the records in scorm_scoes would be deleted and recreated generating new ids for each record) The scorm_scoes table is the only one that updates with this patch - other tables will have data deleted and recreated. hopefully that makes sense - ping Dan M if you need help.
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      master_MDL-41434

      Description

      The order of records in the scorm_scoes table is used so each time we update a SCORM package we delete the existing data and recreate it - this can cause a range of different issues (see linked bugs)

      We should add a sortorder field to the scorm_scoes table and use this for the order of scoes instead of deleting/re-creating them.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              danmarsden Dan Marsden added a comment -

              waited over 2 weeks for peer review - pushing up for integration.

              Show
              danmarsden Dan Marsden added a comment - waited over 2 weeks for peer review - pushing up for integration.
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Couldn't spot anything wrong here Dan - its been integrated now

              Show
              samhemelryk Sam Hemelryk added a comment - Couldn't spot anything wrong here Dan - its been integrated now
              Hide
              fred Frédéric Massart added a comment -

              Passing this, thanks!

              I confirm that:

              • The IDs have not been altered, only 2 new entries were added (sco, asset).
              • The sortorder has been updated
              • After updating the second scorm activity, when I start the activity the summary appears exact as appeared the first one.

              Two things that are probably not related, but are to be considered. Will raise issues if need be. Can you comment on that Dan Marsden?

              • I cannot upload a scorm activity using the DND feature on the course page, this is the error (in error log, because the spinner never stops):

              [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP Fatal error:  Call to a member function get_data() on a non-object in /home/fred/www/repositories/im/moodle/mod/scorm/lib.php on line 124, referer: http://fred.moodle.local/im/course/view.php?id=7
              [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP Stack trace:, referer: http://fred.moodle.local/im/course/view.php?id=7
              [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP   1. {main}() /home/fred/www/repositories/im/moodle/course/dndupload.php:0, referer: http://fred.moodle.local/im/course/view.php?id=7
              [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP   2. dndupload_ajax_processor->process() /home/fred/www/repositories/im/moodle/course/dndupload.php:41, referer: http://fred.moodle.local/im/course/view.php?id=7
              [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP   3. dndupload_ajax_processor->handle_file_upload() /home/fred/www/repositories/im/moodle/course/dnduploadlib.php:515, referer: http://fred.moodle.local/im/course/view.php?id=7
              [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP   4. plugin_callback() /home/fred/www/repositories/im/moodle/course/dnduploadlib.php:547, referer: http://fred.moodle.local/im/course/view.php?id=7
              [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP   5. component_callback() /home/fred/www/repositories/im/moodle/lib/moodlelib.php:7213, referer: http://fred.moodle.local/im/course/view.php?id=7
              [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP   6. call_user_func_array() /home/fred/www/repositories/im/moodle/lib/moodlelib.php:7260, referer: http://fred.moodle.local/im/course/view.php?id=7
              [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP   7. scorm_dndupload_handle() /home/fred/www/repositories/im/moodle/lib/moodlelib.php:0, referer: http://fred.moodle.local/im/course/view.php?id=7
              [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP   8. scorm_add_instance() /home/fred/www/repositories/im/moodle/mod/scorm/lib.php:1298, referer: http://fred.moodle.local/im/course/view.php?id=7
              

              • This is not really an issue, but I would suggest that "Auto update frequency" is placed after the file manager. It is confusing to have to choose that before actually choosing the package.

              Cheers,
              Fred

              Show
              fred Frédéric Massart added a comment - Passing this, thanks! I confirm that: The IDs have not been altered, only 2 new entries were added (sco, asset). The sortorder has been updated After updating the second scorm activity, when I start the activity the summary appears exact as appeared the first one. Two things that are probably not related, but are to be considered. Will raise issues if need be. Can you comment on that Dan Marsden ? I cannot upload a scorm activity using the DND feature on the course page, this is the error (in error log, because the spinner never stops): [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP Fatal error: Call to a member function get_data() on a non-object in /home/fred/www/repositories/im/moodle/mod/scorm/lib.php on line 124, referer: http://fred.moodle.local/im/course/view.php?id=7 [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP Stack trace:, referer: http://fred.moodle.local/im/course/view.php?id=7 [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP 1. {main}() /home/fred/www/repositories/im/moodle/course/dndupload.php:0, referer: http://fred.moodle.local/im/course/view.php?id=7 [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP 2. dndupload_ajax_processor->process() /home/fred/www/repositories/im/moodle/course/dndupload.php:41, referer: http://fred.moodle.local/im/course/view.php?id=7 [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP 3. dndupload_ajax_processor->handle_file_upload() /home/fred/www/repositories/im/moodle/course/dnduploadlib.php:515, referer: http://fred.moodle.local/im/course/view.php?id=7 [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP 4. plugin_callback() /home/fred/www/repositories/im/moodle/course/dnduploadlib.php:547, referer: http://fred.moodle.local/im/course/view.php?id=7 [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP 5. component_callback() /home/fred/www/repositories/im/moodle/lib/moodlelib.php:7213, referer: http://fred.moodle.local/im/course/view.php?id=7 [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP 6. call_user_func_array() /home/fred/www/repositories/im/moodle/lib/moodlelib.php:7260, referer: http://fred.moodle.local/im/course/view.php?id=7 [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP 7. scorm_dndupload_handle() /home/fred/www/repositories/im/moodle/lib/moodlelib.php:0, referer: http://fred.moodle.local/im/course/view.php?id=7 [Wed Sep 18 10:49:06 2013] [error] [client 192.168.100.54] PHP 8. scorm_add_instance() /home/fred/www/repositories/im/moodle/mod/scorm/lib.php:1298, referer: http://fred.moodle.local/im/course/view.php?id=7 This is not really an issue, but I would suggest that "Auto update frequency" is placed after the file manager. It is confusing to have to choose that before actually choosing the package. Cheers, Fred
              Hide
              danmarsden Dan Marsden added a comment -

              thanks Fred - DND must be a regression from some other work we were doing - I saw the new tracker issue thanks, I'll get that sorted this week.

              Auto update - makes sense - previously it wasn't used by the file picker at all but last week we integrated a patch (that might be causing that regression) that allows a different workflow and auto-update to work with files uploaded via the filepicker - If you don't add a new bug for that I'll try to remember to do that tomorrow.

              Show
              danmarsden Dan Marsden added a comment - thanks Fred - DND must be a regression from some other work we were doing - I saw the new tracker issue thanks, I'll get that sorted this week. Auto update - makes sense - previously it wasn't used by the file picker at all but last week we integrated a patch (that might be causing that regression) that allows a different workflow and auto-update to work with files uploaded via the filepicker - If you don't add a new bug for that I'll try to remember to do that tomorrow.
              Hide
              fred Frédéric Massart added a comment -

              Thanks for clarifying that Dan, I have raised MDL-41855.

              Show
              fred Frédéric Massart added a comment - Thanks for clarifying that Dan, I have raised MDL-41855 .
              Hide
              matteo Matteo Scaramuccia added a comment -

              Here is, probably, the DnD issue: MDL-41848

              Show
              matteo Matteo Scaramuccia added a comment - Here is, probably, the DnD issue: MDL-41848
              Hide
              samhemelryk Sam Hemelryk added a comment -

              Yarrr me 'arties, good job done. Yer code 'as landed and the weeklies ave been released with your contributions in tow.
              The brethren thank ya for yer 'ard work and if there'd been treasure to ave ya would ave got yer cut.

              Thanks for the effort everyone, another successful weekly release has been rolled.
              Please keep in mind code freeze is just around the corner now, get your new features and improvements in ASAP.

              Many thanks
              Sam

              Show
              samhemelryk Sam Hemelryk added a comment - Yarrr me 'arties, good job done. Yer code 'as landed and the weeklies ave been released with your contributions in tow. The brethren thank ya for yer 'ard work and if there'd been treasure to ave ya would ave got yer cut. Thanks for the effort everyone, another successful weekly release has been rolled. Please keep in mind code freeze is just around the corner now, get your new features and improvements in ASAP. Many thanks Sam

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    18/Nov/13