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

backup/restore_questions_activity_structure_step cannot cope with different types of usage.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: Backup, Questions
    • Labels:
      None
    • Testing Instructions:
      Hide

      1. You need a quiz with user data.

      2. Back it up and restore it. (Either the whole course, or just the one activity, or, if possible test both.)

      3. Verify that all the attempt data is correctly transferred. (Side-by-side compare of the quiz grades and responses reports in two browser windows is probably an effective way to do that.)

      That just tests that there are no regressions.

      There is no way to actually test that using a prefix works. The offlinequiz module that this was developed for has not been released yet because it is still being tested. Jurgen (offlinequiz developer) has been testing this, and confirms that it works for them.

      Show
      1. You need a quiz with user data. 2. Back it up and restore it. (Either the whole course, or just the one activity, or, if possible test both.) 3. Verify that all the attempt data is correctly transferred. (Side-by-side compare of the quiz grades and responses reports in two browser windows is probably an effective way to do that.) That just tests that there are no regressions. There is no way to actually test that using a prefix works. The offlinequiz module that this was developed for has not been released yet because it is still being tested. Jurgen (offlinequiz developer) has been testing this, and confirms that it works for them.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Suppose an activity uses question_usages in two different ways. For example, there might be template usages that are part of the activity settings, and then actual usages that are part of the user data.

      This is a problem, because different XML elements in the backup file that contain other elements cannot have the same name. In other words, a structure like

      modname
          templates
              template
                  question_usage
                      ...
          attempts
              attempt
                  question_usage
                      ...

      in not allowed. Some of the elements would need to be renamed, like

      modname
          templates
              template
                  template_question_usage
                      ...
          attempts
              attempt
                  question_usage
                      ...

      Fortunately, I think it is possible to do this. We just need to add an optional $nameprefix argument to backup_questions_activity_structure_step::add_question_usages and restore_questions_activity_structure_step::add_question_usages.

      I am about to put a patch up for review.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  3/Dec/12