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

refactor question import code to allow reuse of code for an individual question's import

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      1. Run all the unit tests in question/format.
      2. Import the four sample files in question/format/xml/tests/fixtures.
      3. Find a category in your question bank containing a lot of questions. Export it as Moodle XML, and re-import into a new course/category. Check that everything has come across correctly.

      Show
      1. Run all the unit tests in question/format. 2. Import the four sample files in question/format/xml/tests/fixtures. 3. Find a category in your question bank containing a lot of questions. Export it as Moodle XML, and re-import into a new course/category. Check that everything has come across correctly.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
      wip_MDL-39230_2_5

      Description

      For combined question type we need a way to import and export sub questions from the question engine.

      It is easy to transform the sub question data to an xml export to include in the xml for the combined question xml.

      But to import that xml back into the db I want to reuse the existing code for interpretting the xml and then for saving the data in the db.

      I have refactored the question code so that the existing question type api is not changed but have added access to the needed functions.

      I thought it was a good idea to move the saving of the common question settings into the base question type class which is where the code for saving the common settings from the form is already.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

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