Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-6787

Restore doesn't recreate question dependencies properly in some cases

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.2.2
    • Component/s: Module: Questionnaire
    • Labels:
      None

      Description

      From github issue #80:

      Import/Restore not working for dependencies, if the parent question (RADIO or DROPDOWN) was created after the child question and has been moved before the to-be-child afterwards.
      The parent-question is stored AFTER the child question due to its higher ID in the Backup-XML-File inside the mbz-File. While iterating through the file, moodle can't get the new mappingid for the depending record, because it doesn't exist yet.

      This leads to the result: dependquestion = 0, dependchoice = old choice ID

      Example:
      Create a questionnaire with some questions (IDs 1 2 3 4 5). Move the last question (ID 5) somewhere before the second last question (ID 4). Set the new last question to be dependend on the answer in (ID 5).

      Now create a backup. The questions in the questionnaire are stored sequentially according to the question-ID.

      Now import the mbz-File and restore the questionnaire. The questionnaire gets importet smoothly, but misses the correct dependency between former ID4 to ID5.

      Tested with MOODLE_32_STABLE.

        Attachments

          Activity

            People

            • Assignee:
              mchurch Mike Churchward
              Reporter:
              mchurch Mike Churchward
              Participants:
              Component watchers:
              Mike Churchward
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Mar/17