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

Moodle XML question export fails with a fatal error if there is an unrecognised qtype in the question bank.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.5, 2.2.2
    • Fix Version/s: 2.1.6, 2.2.3
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      1. Go into the question bank for a course. Note the id of a question.

      2. Go into the database, and edit the value in the 'qtype' column for that question, to be something unrecognised, like unknownqtype.

      3. Export the questions from this category, and make sure that there is not a fatal error.

      4. Inspect the exported file, and make sure that all the questions that were in the question category were exported, except for the one you hacked.

      (5. Optional, you may wish to set question.qtype back to the original value.)

      Show
      1. Go into the question bank for a course. Note the id of a question. 2. Go into the database, and edit the value in the 'qtype' column for that question, to be something unrecognised, like unknownqtype. 3. Export the questions from this category, and make sure that there is not a fatal error. 4. Inspect the exported file, and make sure that all the questions that were in the question category were exported, except for the one you hacked. (5. Optional, you may wish to set question.qtype back to the original value.)
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Because of testing other bugs, I had a question in my database where I had manually edited the question type to 'unknownqtype'. This caused a fatal error on export. Instead, I think this sort of question should just be silently skipped, so you can still export the other questions.

        Gliffy Diagrams

          Activity

          Hide
          stronk7 Eloy Lafuente (stronk7) 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
          stronk7 Eloy Lafuente (stronk7) 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
          poltawski Dan Poltawski added a comment -

          Thanks Tim,

          This has been integrated now

          Show
          poltawski Dan Poltawski added a comment - Thanks Tim, This has been integrated now
          Hide
          abgreeve Adrian Greeve added a comment -

          Tested in 2.1, 2.2 and master. I edited the qtype of a question, exported it - No errors, inspected the file - the question was omitted, and then changed the qtype back and inspected again - now included.
          No problems.
          Thanks.

          Show
          abgreeve Adrian Greeve added a comment - Tested in 2.1, 2.2 and master. I edited the qtype of a question, exported it - No errors, inspected the file - the question was omitted, and then changed the qtype back and inspected again - now included. No problems. Thanks.
          Hide
          nebgor Aparup Banerjee added a comment -

          The code here has been spread to upstream moodle repositories and mirrors for anyone to use .

          Closing, have a good weekend!

          Show
          nebgor Aparup Banerjee added a comment - The code here has been spread to upstream moodle repositories and mirrors for anyone to use . Closing, have a good weekend!

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/May/12