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

Improve XML question import format handling of duplicated files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.3.5, 2.4.2
    • 2.3.4, 2.4.1, 2.5
    • Questions
    • None
    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • Hide

      Verify that without this patch trying to import the attached sample XML file produce the error message "Can not create file" followed by the name of a draftfile ending in moodle_logo_small.png and import fails.

      With this patch applied file is imported but a developper debugging message is displayed :
      Duplicate file in XML: moodle_logo_small.png

      line 177 of \question\format\xml\format.php: call to debugging()
      line 159 of \question\format\xml\format.php: call to qformat_xml->import_files_as_draft()
      line 214 of \question\format\xml\format.php: call to qformat_xml->import_text_with_files()
      line 513 of \question\format\xml\format.php: call to qformat_xml->import_headers()
      line 915 of \question\format\xml\format.php: call to qformat_xml->import_truefalse()
      line 303 of \question\format.php: call to qformat_xml->readquestions()
      line 119 of \question\import.php: call to qformat_default->importprocess()

      After the import verify that a working true/false question has been correctly imported with twice the same small Moodle logo included in question text.

      Show
      Verify that without this patch trying to import the attached sample XML file produce the error message "Can not create file" followed by the name of a draftfile ending in moodle_logo_small.png and import fails. With this patch applied file is imported but a developper debugging message is displayed : Duplicate file in XML: moodle_logo_small.png line 177 of \question\format\xml\format.php: call to debugging() line 159 of \question\format\xml\format.php: call to qformat_xml->import_files_as_draft() line 214 of \question\format\xml\format.php: call to qformat_xml->import_text_with_files() line 513 of \question\format\xml\format.php: call to qformat_xml->import_headers() line 915 of \question\format\xml\format.php: call to qformat_xml->import_truefalse() line 303 of \question\format.php: call to qformat_xml->readquestions() line 119 of \question\import.php: call to qformat_default->importprocess() After the import verify that a working true/false question has been correctly imported with twice the same small Moodle logo included in question text.

      During working on MDL-37934 it was discovered that if an XML contains the same file several times for the same field of the same question an error message not very explicit is displayed and the import abort for the whole file.
      This issue is about a better handling of this issue that can only happen with XML files generated by external system like MoodleXMLBuilder not with files generated by Moodle question XML export.

            jmvedrine Jean-Michel Vedrine
            jmvedrine Jean-Michel Vedrine
            Tim Hunt Tim Hunt
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Frédéric Massart Frédéric Massart
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.