Moodle
  1. Moodle
  2. MDL-23662

IMS Common Cartridge Import Detailed Errors

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.9.9
    • Fix Version/s: 1.9.10
    • Component/s: Backup
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      33121

      Description

      In trying to import an Angel-exported IMS Common Cartridge, I received an error "The schema is not valid."

      I see several similar issues here, most closed with "not a bug"

      Testing with IMS Desktop Validator, I found that, indeed, Angel generates broken cartridges.

      But downloading and installing and validating took a fair amount of effort, and I would have preferred Moodle to have just told me specifically what was broken instead.

      I therefore humbly submit my first patch, which organizes import errors by level and dumps them out as notify messages. It's a bit verbose, and perhaps should be an expandable display: none; div instead, but it's a start. I don't know enough Moodle internals yet to do that properly, and I doubt you'd want inline JS hackery in the patch...

      I added a CSS class for level, but did not actually style them in any particular way; I leave that to somebody more familiar with Moodle front-end.

      There is not much I can do to convince Blackboard to actually fix Angel IMS CC export; But at least I can help Moodlers know that the cartridge they are trying to import is truly broken, and exactly how.

      This also helps nudge Moodle closer to IMS CC compliance, which specifically states:

      "On import LMS should confirm that package has imported properly or that there were errors importing the package. Error messages should attempt to direct the user to the problem within the package such as identify a resource that could not be located within the package." section 6.2.4 of imscc_profilev1p0.

        Activity

        Hide
        Richard Lynch added a comment -

        Not directly relevant, but in case somebody ends up here:

        Your first step to fix the cartridge is to unzip it, edit the imsmanifest.xml file in the root, and replace all '\' with '//' so the URLs look correct, compared to the non-broken ones in the XML.

        Then update that file in the zip with:
        zip -u YOURFILE.zip imsmanifest.xml

        That got me past the XML being invalid.

        Moodle claims my course has no title, however, and I'm a bit stuck there for now.

        IMS Validator tool still has 1 Error and many warnings. The error reads:
        Results for test package file with uri 'QuestionBank/questionbank.xml'

        • Validation against schema file with uri 'ims_qtiasiv1p2_localised.xsd'
          o Found the following errors:
          Line Message
          2 cvc-complex-type.2.4.b: The content of element 'objectbank' is not complete. One of ' {"http://www.imsglobal.org/xsd/ims_qtiasiv1p2":qtimetadata, "http://www.imsglobal.org/xsd/ims_qtiasiv1p2":item}

          ' is expected.

        I have very little idea what that means in English, other than some XML element being missing.

        There are also 95 files in the zip with no reference, most of which are dropbox submissions and their _about.html pages...

        The IMS CC vaidator tool is not complaining of a missing course title; but Moodle is. I suspect Moodle is not quite correct in this detail, but don't really know...

        Show
        Richard Lynch added a comment - Not directly relevant, but in case somebody ends up here: Your first step to fix the cartridge is to unzip it, edit the imsmanifest.xml file in the root, and replace all '\' with '//' so the URLs look correct, compared to the non-broken ones in the XML. Then update that file in the zip with: zip -u YOURFILE.zip imsmanifest.xml That got me past the XML being invalid. Moodle claims my course has no title, however, and I'm a bit stuck there for now. IMS Validator tool still has 1 Error and many warnings. The error reads: Results for test package file with uri 'QuestionBank/questionbank.xml' Validation against schema file with uri 'ims_qtiasiv1p2_localised.xsd' o Found the following errors: Line Message 2 cvc-complex-type.2.4.b: The content of element 'objectbank' is not complete. One of ' {"http://www.imsglobal.org/xsd/ims_qtiasiv1p2":qtimetadata, "http://www.imsglobal.org/xsd/ims_qtiasiv1p2":item} ' is expected. I have very little idea what that means in English, other than some XML element being missing. There are also 95 files in the zip with no reference, most of which are dropbox submissions and their _about.html pages... The IMS CC vaidator tool is not complaining of a missing course title; but Moodle is. I suspect Moodle is not quite correct in this detail, but don't really know...
        Hide
        Richard Lynch added a comment -

        I have removed the offending questionbank (empty anyway) and all the uploaded files (student submissions, use case dubious) and the cartridge now validates.
        Moodle still complains of a missing course title.
        I shall attempt to replicate with a non-proprietary bogus course, and submit a bug report, as a validating cartridge should load, imho...

        Show
        Richard Lynch added a comment - I have removed the offending questionbank (empty anyway) and all the uploaded files (student submissions, use case dubious) and the cartridge now validates. Moodle still complains of a missing course title. I shall attempt to replicate with a non-proprietary bogus course, and submit a bug report, as a validating cartridge should load, imho...
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Assigning this to Darko, sounds interesting the idea of getting more info about the validation problems...

        Show
        Eloy Lafuente (stronk7) added a comment - Assigning this to Darko, sounds interesting the idea of getting more info about the validation problems...
        Hide
        Darko Miletic added a comment -

        If you can send the package you used for testing that would be great.

        Show
        Darko Miletic added a comment - If you can send the package you used for testing that would be great.
        Hide
        Darko Miletic added a comment -

        ccpatch2.patch is cleaned up and improved patch adopting good ides from Richard.

        Show
        Darko Miletic added a comment - ccpatch2.patch is cleaned up and improved patch adopting good ides from Richard.
        Hide
        Darko Miletic added a comment -

        Your turn Eloy

        Show
        Darko Miletic added a comment - Your turn Eloy
        Hide
        Richard Lynch added a comment -

        Here is a stripped down version that generates a sampling of the errors of Angel's broken IMS CC export.

        Note that the real one also had a ton of files in the .zip that were not on the manifest, which generated 95 more errors...

        An expandable "+Details" sort of UI that would show the errors may be a worthwhile endeavor, at some point...

        Show
        Richard Lynch added a comment - Here is a stripped down version that generates a sampling of the errors of Angel's broken IMS CC export. Note that the real one also had a ton of files in the .zip that were not on the manifest, which generated 95 more errors... An expandable "+Details" sort of UI that would show the errors may be a worthwhile endeavor, at some point...

          People

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

            Dates

            • Created:
              Updated:
              Resolved: