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

SCORM replace filepicker element with filemanager and allow linking.

    Details

    • Testing Instructions:
      Hide

      Test 1
      Upload a SCORM package using the add an activity dialogue then use the filepicker to upload a SCORM, set "auto-updat frequency" to every day (or every time it's used)
      Save page and make sure the error "Auto-update frequency can only be set when the package file is hosted externally" is thrown.

      Test 2
      Set up a file level repository and store some SCORM packages in the repository.
      Create a new SCORM package using the add an activity dialogue and use the filepicker to select a SCORM zip package from a repository and use the option "create an alias/shortcut to the file" - save the SCORM and make sure the SCORM package loads as expected. Also test the option "Make a copy of the file" to make sure that works as expected as well.

      Test 3
      Set up a file level repository and store some SCORM packages in the repository.
      Create a new SCORM package using the add an activity dialogue and use the filepicker to select a SCORM zip package from a repository and use the option "create an alias/shortcut to the file" - also set the auto update frequency to "every time it's used" - Enter the SCORM to make sure it loads as expected.
      Modify the SCORM package stored in the external repository (keeping the same scorm zip filename)
      by changing the title of one of the scos or by modifying something else you will recognise and then enter the SCORM
      and make sure the SCORM loads when entering as a student.

      Test 4 (cron)
      Set up a file level repository and store some SCORM packages in the repository.
      Create a new SCORM package using the add an activity dialogue and use the filepicker to select a SCORM zip package from a repository and use the option "create an alias/shortcut to the file" - also set the auto update frequency to "every day" - Enter the SCORM to make sure it loads as expected.
      Modify the SCORM package stored in the external repository (keeping the same scorm zip filename)
      by changing the title of one of the scos or by modifying something else you will recognise (don't enter the SCORM again yet)

      Run the scorm cron code (it will only run close to midnight unless you hack it) - It could be good to add a bug tracker to improve the time handling in scorm_cron.
      After scorm_cron code has triggered the daily update stuff enter the SCORM as a student and check that the content was updated.

      Show
      Test 1 Upload a SCORM package using the add an activity dialogue then use the filepicker to upload a SCORM, set "auto-updat frequency" to every day (or every time it's used) Save page and make sure the error "Auto-update frequency can only be set when the package file is hosted externally" is thrown. Test 2 Set up a file level repository and store some SCORM packages in the repository. Create a new SCORM package using the add an activity dialogue and use the filepicker to select a SCORM zip package from a repository and use the option "create an alias/shortcut to the file" - save the SCORM and make sure the SCORM package loads as expected. Also test the option "Make a copy of the file" to make sure that works as expected as well. Test 3 Set up a file level repository and store some SCORM packages in the repository. Create a new SCORM package using the add an activity dialogue and use the filepicker to select a SCORM zip package from a repository and use the option "create an alias/shortcut to the file" - also set the auto update frequency to "every time it's used" - Enter the SCORM to make sure it loads as expected. Modify the SCORM package stored in the external repository (keeping the same scorm zip filename) by changing the title of one of the scos or by modifying something else you will recognise and then enter the SCORM and make sure the SCORM loads when entering as a student. Test 4 (cron) Set up a file level repository and store some SCORM packages in the repository. Create a new SCORM package using the add an activity dialogue and use the filepicker to select a SCORM zip package from a repository and use the option "create an alias/shortcut to the file" - also set the auto update frequency to "every day" - Enter the SCORM to make sure it loads as expected. Modify the SCORM package stored in the external repository (keeping the same scorm zip filename) by changing the title of one of the scos or by modifying something else you will recognise (don't enter the SCORM again yet) Run the scorm cron code (it will only run close to midnight unless you hack it) - It could be good to add a bug tracker to improve the time handling in scorm_cron. After scorm_cron code has triggered the daily update stuff enter the SCORM as a student and check that the content was updated.
    • URL:
      N/A
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_23_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      master_MDL-28579

      Description

      Moodle repositories now have a feature in the filmanager element that allows "linking" to files rather than copying directly into Moodle. We need to allow SCORM to use this feature.
      first allow linking to the package/zip file and then running some form of check to update the unpackaged content for that individual SCORM.

      second allow unzipped content and linking to an imsmanifest.xml file and not storing/extracting the content into Moodle at all.

      I may create sub-tasks on this to achieve the different bits that are required.

      See http://moodle.org/mod/forum/discuss.php?d=178751 for recent discussion and at least two votes for this improvement.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              salvetore Michael de Raadt added a comment -

              Dan: Could you comment on this?

              Show
              salvetore Michael de Raadt added a comment - Dan: Could you comment on this?
              Hide
              danmarsden Dan Marsden added a comment -

              yep - giving this one back to moodle.com as it's really an issue with the repositories (but I think easy to solve)

              SCORM needs relative file linking to work - easiest way to test this without scorm would be to have a file system repo with a directory of web files - eg index.htm, file1.htm

              When selecting a file - it should be possible to select index.htm and index.htm should be able to have a relative link inside that goes to "file1.htm" - so when index.htm is loaded in the browser, clicking the relative link to file1.htm should work.

              Show
              danmarsden Dan Marsden added a comment - yep - giving this one back to moodle.com as it's really an issue with the repositories (but I think easy to solve) SCORM needs relative file linking to work - easiest way to test this without scorm would be to have a file system repo with a directory of web files - eg index.htm, file1.htm When selecting a file - it should be possible to select index.htm and index.htm should be able to have a relative link inside that goes to "file1.htm" - so when index.htm is loaded in the browser, clicking the relative link to file1.htm should work.
              Hide
              avionwbt Ian Wright added a comment -

              Additionally, while Dan mentions "web files - eg index.htm, file1.htm", more complex SCOs are likely to have assets (referenced resources, eg audio, video, images, XML) and it is more likely that it is these assets rather than the SCO that need separate updating.

              Show
              avionwbt Ian Wright added a comment - Additionally, while Dan mentions "web files - eg index.htm, file1.htm", more complex SCOs are likely to have assets (referenced resources, eg audio, video, images, XML) and it is more likely that it is these assets rather than the SCO that need separate updating.
              Hide
              danmarsden Dan Marsden added a comment -

              yes - but the issue here isn't really about "updating" - it's about how the files in the repo are accessed - the updating part is really just "why" this is needed - and it's much easier for a developer to understand the above analogy than try to figure out how SCORM works!

              Show
              danmarsden Dan Marsden added a comment - yes - but the issue here isn't really about "updating" - it's about how the files in the repo are accessed - the updating part is really just "why" this is needed - and it's much easier for a developer to understand the above analogy than try to figure out how SCORM works!
              Hide
              danmarsden Dan Marsden added a comment -

              Just realised this bug should really be a replacement for the IMS repository available in 1.9

              Show
              danmarsden Dan Marsden added a comment - Just realised this bug should really be a replacement for the IMS repository available in 1.9
              Hide
              my_account Christian Peters added a comment -

              This is absolutely critical for my company, as we're using lot's of courses that are crashing because of this! I'd love to see an increasing priority! Thanks!

              Show
              my_account Christian Peters added a comment - This is absolutely critical for my company, as we're using lot's of courses that are crashing because of this! I'd love to see an increasing priority! Thanks!
              Hide
              matteo Matteo Scaramuccia added a comment -

              Hi All,
              look at DAVRoot: Moodle Files through WebDAV for a possibile solution (for Moodle and not just AICC/SCORM activity) and take into account my personal opinion about changes out of the ZIP Package here.
              Probably it could be nicer to have a CLI to update single big packages or to deploy rapidly&massively a list of packages.

              HTH,
              Matteo

              Show
              matteo Matteo Scaramuccia added a comment - Hi All, look at DAVRoot: Moodle Files through WebDAV for a possibile solution (for Moodle and not just AICC/SCORM activity) and take into account my personal opinion about changes out of the ZIP Package here . Probably it could be nicer to have a CLI to update single big packages or to deploy rapidly&massively a list of packages. HTH, Matteo
              Hide
              kstokking Kris Stokking added a comment -

              Is there a workaround for sites who are using IMS Repository functionality in 1.9 and looking to upgrade to 2.X? If not, this would be a pretty major roadblock for those sites, as they would need to recreate all of their content on the other side. It seems like now would be the right time to consider this issue for development as it aligns well with the improved support for linked file content slated for 2.3.

              Show
              kstokking Kris Stokking added a comment - Is there a workaround for sites who are using IMS Repository functionality in 1.9 and looking to upgrade to 2.X? If not, this would be a pretty major roadblock for those sites, as they would need to recreate all of their content on the other side. It seems like now would be the right time to consider this issue for development as it aligns well with the improved support for linked file content slated for 2.3.
              Hide
              danmarsden Dan Marsden added a comment -

              changed title/description on this as we now have the alias feature in 2.3 supported by the core files api that might allow us to handle this better - there are a few things we'll need to be careful with but I think it's now possible by modifying SCORM code.

              I've assigned this back to me although it's highly likely to sit here for a while unless someone is willing to fund my time to work on this or if someone else does some development and submits a patch for me to review.

              Show
              danmarsden Dan Marsden added a comment - changed title/description on this as we now have the alias feature in 2.3 supported by the core files api that might allow us to handle this better - there are a few things we'll need to be careful with but I think it's now possible by modifying SCORM code. I've assigned this back to me although it's highly likely to sit here for a while unless someone is willing to fund my time to work on this or if someone else does some development and submits a patch for me to review.
              Hide
              danmarsden Dan Marsden added a comment -

              here's the start of this work - hasn't had much testing yet but uses the new filemanager element which allows linking.

              Show
              danmarsden Dan Marsden added a comment - here's the start of this work - hasn't had much testing yet but uses the new filemanager element which allows linking.
              Hide
              danmarsden Dan Marsden added a comment -

              bouncing this up for peer review - this repo also contains the patch from MDL-35380

              Show
              danmarsden Dan Marsden added a comment - bouncing this up for peer review - this repo also contains the patch from MDL-35380
              Hide
              fred Frédéric Massart added a comment - - edited

              Hi Dan,

              your patch looks good. It just seems that the cron job won't fetch the package because its type is local. Could you check the different places where the package update is triggered and ensure that this reference would be updated as well? Then, your testing instructions could also simulate a cron update.

              Thanks!
              Fred

              Show
              fred Frédéric Massart added a comment - - edited Hi Dan, your patch looks good. It just seems that the cron job won't fetch the package because its type is local . Could you check the different places where the package update is triggered and ensure that this reference would be updated as well? Then, your testing instructions could also simulate a cron update. Thanks! Fred
              Hide
              danmarsden Dan Marsden added a comment -

              wow - brilliant catch Fred! - have just pushed a fix for that.

              Show
              danmarsden Dan Marsden added a comment - wow - brilliant catch Fred! - have just pushed a fix for that.
              Hide
              danmarsden Dan Marsden added a comment -

              This contains the patch for MDL-39910 as well which must be integrated first.

              Show
              danmarsden Dan Marsden added a comment - This contains the patch for MDL-39910 as well which must be integrated first.
              Hide
              damyon Damyon Wiese added a comment -

              The blocker issue for this had been reopened - I'll leave this issue open in the integration list in case you want to rebase it without the blocker.

              Show
              damyon Damyon Wiese added a comment - The blocker issue for this had been reopened - I'll leave this issue open in the integration list in case you want to rebase it without the blocker.
              Hide
              danmarsden Dan Marsden added a comment -

              thanks - rebased this against master and no longer reliant on MDL-39910

              Show
              danmarsden Dan Marsden added a comment - thanks - rebased this against master and no longer reliant on MDL-39910
              Hide
              damyon Damyon Wiese added a comment -

              Thanks Dan,

              This works fine when adding a new scorm,

              But editing an existing scorm is throwing errors:

              Warning: Invalid argument supplied for foreach() in /home/damyonw/Documents/Moodle/integration/master/moodle/lib/pear/HTML/QuickForm.php on line 1267 Call Stack: 0.0009 850376 1. {main}() /home/damyonw/Documents/Moodle/integration/master/moodle/course/modedit.php:0 0.4682 61194048 2. update_moduleinfo() /home/damyonw/Documents/Moodle/integration/master/moodle/course/modedit.php:260 0.4753 61196336 3. scorm_update_instance() /home/damyonw/Documents/Moodle/integration/master/moodle/course/modlib.php:473 0.4753 61196608 4. moodleform->get_new_filename() /home/damyonw/Documents/Moodle/integration/master/moodle/mod/scorm/lib.php:201 0.4754 61196608 5. MoodleQuickForm->exportValues() /home/damyonw/Documents/Moodle/integration/master/moodle/lib/formslib.php:671 0.4755 61198408 6. HTML_QuickForm::arrayMerge() /home/damyonw/Documents/Moodle/integration/master/moodle/lib/formslib.php:1944

              Can you please take a look?

              Show
              damyon Damyon Wiese added a comment - Thanks Dan, This works fine when adding a new scorm, But editing an existing scorm is throwing errors: Warning: Invalid argument supplied for foreach() in /home/damyonw/Documents/Moodle/integration/master/moodle/lib/pear/HTML/QuickForm.php on line 1267 Call Stack: 0.0009 850376 1. {main}() /home/damyonw/Documents/Moodle/integration/master/moodle/course/modedit.php:0 0.4682 61194048 2. update_moduleinfo() /home/damyonw/Documents/Moodle/integration/master/moodle/course/modedit.php:260 0.4753 61196336 3. scorm_update_instance() /home/damyonw/Documents/Moodle/integration/master/moodle/course/modlib.php:473 0.4753 61196608 4. moodleform->get_new_filename() /home/damyonw/Documents/Moodle/integration/master/moodle/mod/scorm/lib.php:201 0.4754 61196608 5. MoodleQuickForm->exportValues() /home/damyonw/Documents/Moodle/integration/master/moodle/lib/formslib.php:671 0.4755 61198408 6. HTML_QuickForm::arrayMerge() /home/damyonw/Documents/Moodle/integration/master/moodle/lib/formslib.php:1944 Can you please take a look?
              Hide
              danmarsden Dan Marsden added a comment -

              grrr - who wrote that patch!....

              pushed a commit to fix it. Thanks.

              Show
              danmarsden Dan Marsden added a comment - grrr - who wrote that patch!.... pushed a commit to fix it. Thanks.
              Hide
              danmarsden Dan Marsden added a comment -

              rebased as a single commit.

              Show
              danmarsden Dan Marsden added a comment - rebased as a single commit.
              Hide
              damyon Damyon Wiese added a comment -

              Thanks Dan,

              Adding and editing is working for me now. The patch looks good. Integrated to master only.

              Cheers, Damyon

              Show
              damyon Damyon Wiese added a comment - Thanks Dan, Adding and editing is working for me now. The patch looks good. Integrated to master only. Cheers, Damyon
              Hide
              damyon Damyon Wiese added a comment -

              PHP Fatal error: Call to undefined method zip_archive::is_external_file() in /Users/Shared/Jenkins/Home/git_repositories/master/mod/scorm/lib.php on line 1342
              PHP Stack trace:
              PHP 1.

              {main}

              () /opt/local/bin/phpunit:0
              PHP 2. PHPUnit_TextUI_Command::main() /opt/local/bin/phpunit:46
              PHP 3. PHPUnit_TextUI_Command->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/TextUI/Command.php:129
              PHP 4. PHPUnit_TextUI_TestRunner->doRun() /opt/local/lib/php53/pear/share/pear/PHPUnit/TextUI/Command.php:176
              PHP 5. PHPUnit_Framework_TestSuite->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/TextUI/TestRunner.php:349
              PHP 6. PHPUnit_Framework_TestSuite->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestSuite.php:705
              PHP 7. PHPUnit_Framework_TestSuite->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestSuite.php:705
              PHP 8. PHPUnit_Framework_TestSuite->runTest() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestSuite.php:745
              PHP 9. PHPUnit_Framework_TestCase->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestSuite.php:775
              PHP 10. PHPUnit_Framework_TestResult->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestCase.php:776
              PHP 11. basic_testcase->runBare() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestResult.php:648
              PHP 12. PHPUnit_Framework_TestCase->runBare() /Users/Shared/Jenkins/Home/git_repositories/master/lib/phpunit/classes/basic_testcase.php:64
              PHP 13. PHPUnit_Framework_TestCase->runTest() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestCase.php:831
              PHP 14. ReflectionMethod->invokeArgs() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestCase.php:976
              PHP 15. mod_scorm_validatepackage_testcase->test_validate_package() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestCase.php:976
              PHP 16. scorm_validate_package() /Users/Shared/Jenkins/Home/git_repositories/master/mod/scorm/tests/validatepackage_test.php:45

              Show
              damyon Damyon Wiese added a comment - PHP Fatal error: Call to undefined method zip_archive::is_external_file() in /Users/Shared/Jenkins/Home/git_repositories/master/mod/scorm/lib.php on line 1342 PHP Stack trace: PHP 1. {main} () /opt/local/bin/phpunit:0 PHP 2. PHPUnit_TextUI_Command::main() /opt/local/bin/phpunit:46 PHP 3. PHPUnit_TextUI_Command->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/TextUI/Command.php:129 PHP 4. PHPUnit_TextUI_TestRunner->doRun() /opt/local/lib/php53/pear/share/pear/PHPUnit/TextUI/Command.php:176 PHP 5. PHPUnit_Framework_TestSuite->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/TextUI/TestRunner.php:349 PHP 6. PHPUnit_Framework_TestSuite->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestSuite.php:705 PHP 7. PHPUnit_Framework_TestSuite->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestSuite.php:705 PHP 8. PHPUnit_Framework_TestSuite->runTest() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestSuite.php:745 PHP 9. PHPUnit_Framework_TestCase->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestSuite.php:775 PHP 10. PHPUnit_Framework_TestResult->run() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestCase.php:776 PHP 11. basic_testcase->runBare() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestResult.php:648 PHP 12. PHPUnit_Framework_TestCase->runBare() /Users/Shared/Jenkins/Home/git_repositories/master/lib/phpunit/classes/basic_testcase.php:64 PHP 13. PHPUnit_Framework_TestCase->runTest() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestCase.php:831 PHP 14. ReflectionMethod->invokeArgs() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestCase.php:976 PHP 15. mod_scorm_validatepackage_testcase->test_validate_package() /opt/local/lib/php53/pear/share/pear/PHPUnit/Framework/TestCase.php:976 PHP 16. scorm_validate_package() /Users/Shared/Jenkins/Home/git_repositories/master/mod/scorm/tests/validatepackage_test.php:45
              Hide
              danmarsden Dan Marsden added a comment -

              arg - looking.

              Show
              danmarsden Dan Marsden added a comment - arg - looking.
              Hide
              damyon Damyon Wiese added a comment -

              I added a fix for the broken unit tests.

              Show
              damyon Damyon Wiese added a comment - I added a fix for the broken unit tests.
              Hide
              danmarsden Dan Marsden added a comment -

              yay - thanks Damyon.

              Show
              danmarsden Dan Marsden added a comment - yay - thanks Damyon.
              Hide
              damyon Damyon Wiese added a comment -

              This works for me. My changes were limited to updating the footer of the HTML file in the scorm - and seemed to work fine.

              Show
              damyon Damyon Wiese added a comment - This works for me. My changes were limited to updating the footer of the HTML file in the scorm - and seemed to work fine.
              Hide
              poltawski Dan Poltawski added a comment -

              Congratulations! This change has been integrated upstream and is now available from our git and download mirrors. To celebrate, here is a joke:

              A SQL query goes into a bar, walks up to two tables and asks, "Can I join you?"

              Show
              poltawski Dan Poltawski added a comment - Congratulations! This change has been integrated upstream and is now available from our git and download mirrors. To celebrate, here is a joke: A SQL query goes into a bar, walks up to two tables and asks, "Can I join you?"
              Hide
              firevenus Si Yan added a comment -

              Is this with the newest SCORM 2004 4th standard?

              Show
              firevenus Si Yan added a comment - Is this with the newest SCORM 2004 4th standard?

                People

                • Votes:
                  29 Vote for this issue
                  Watchers:
                  28 Start watching this issue

                  Dates

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