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

backup or import of single quiz includes all questions in database

    Details

    • Database:
      MySQL
    • Testing Instructions:
      Hide

      To tester: Note that the original issue has been divided in two. This issue addresses a setting to include questions in the course backup and MDL-41924 minimizes the number of questions included in each activity.

      COURSE SETUP:

      1. Add a course QUIZCOURSE with a number of different modules including a quiz
      2. Add a course NOQUESTIONCOURSE without a quiz or questions, and some other activities
      3. Add a course QUESTIONONLYCOURSE with questions added to the question bank, but no quiz and some other activities

      A1. BACKUP QUIZCOURSE TEST:

      1. Backup QUIZCOURSE with default settings, question bank enabled
      2. VERIFY: Backup backs up correctly
      3. VERIFY: Course can be restored into a another Moodle correctly.
      4. Backup QUIZCOURSE without question bank unselected
      5. VERIFY: The quizes in the course can not be selected for backup
      6. VERIFY: Backup completes correctly
      7. VERIFY: if the backup is unzipped, no questions are included in the backup
      8. VERIFY: Course can be restored into a another Moodle correctly, without the quiz or questions

      A2. BACKUP NOQUESTIONCOURSE TEST:

      1. Backup NOQUESTIONCOURSE with default settings, question bank enabled
      2. VERIFY: Backup backs up correctly
      3. VERIFY: Course can be restored into a another Moodle correctly.
      4. Backup NOQUESTIONCOURSE without question bank unselected
      5. VERIFY: All activities are able to be backed up
      6. VERIFY: Backup completes correctly

      A3. BACKUP QUESTIONONLYCOURSE TEST:

      1. Backup QUESTIONONLYCOURSE with default settings, question bank enabled
      2. VERIFY: Backup backs up correctly
      3. VERIFY: Course can be restored into a another Moodle correctly.
      4. VERIFY: question bank is restored into new course
      5. Backup NOQUESTIONCOURSE without question bank unselected
      6. VERIFY: All activities are able to be backed up
      7. VERIFY: Backup completes correctly
      8. VERIFY: if the backup is unzipped, no questions are included in the backup
      9. VERIFY: Course can be restored into a another Moodle correctly, without questions

      B: Automated backups:

      1. Setup automated backups:
        1. Enable backup_auto_active
        2. Specify a directory in your automated backup setting
        3. Set backup_auto_skip_modif_days to Never
        4. Disable backup_auto_skip_modif_prev
      2. Now you need to run the automated backups with the 'Include question bank set to enabled in automated backup settings
        1. Enable backup_auto_questionbank
        2. Run the automated backups CLI tool: admin/cli/automated_backups.php
        3. VERIFY: the state of the backup files is the same as created in steps A1-A3 with question bank setting enabled
      3. Now run automated backups with 'Include question bank' set to enabled
        1. Disable backup_auto_questionbank
        2. Run the automated backups CLI tool: admin/cli/automated_backups.php
        3. VERIFY: the state of the backup files is the same as created in steps A1-A3 with question bank setting disabled.

      C: Import

      1. Create an empty course
      2. Go to course import
      3. Select the QUIZCOURSE to import frm
      4. Unselect 'include question bank'
      5. VERIFY: that you can't choose the quiz activity to import frm
      6. Select an activity which isn't the quiz to import
      7. VERIFY: that the activity imports correctly
      8. VERIFY: that the question bank remains empty
      9. Run the import again, this time selecting the question bank in settings
      10. Choose the quiz to import
      11. VERIFY: the quiz imports succesfully
      12. VERIFY: the questions are imported into the question bank

      D: Default settings

      1. In general backup default settings, disable question bank from the defaults
      2. Go to a course backup
      3. VERIFY: that 'include question bank' is default disabled
      4. [Note that if you try and enable it and backup that course it doens't work.. that is existing prob MDL-41923]

      E: Backup settings test

      1. Upgrade to lastest version
      2. Go to a course
      3. In your database: DELETE FROM mdl_config_plugins WHERE plugin = 'backup' and name like '%questionbank%';
      4. Purge caches
      5. Go to backup a course (don't let moodle try and get you to set the config settings)
      6. VERIFY: that question bank is ticked in the settings
      7. Run automated backups cli script
      8. VERIFY: no errors are experienced
      Show
      To tester: Note that the original issue has been divided in two. This issue addresses a setting to include questions in the course backup and MDL-41924 minimizes the number of questions included in each activity. COURSE SETUP: Add a course QUIZCOURSE with a number of different modules including a quiz Add a course NOQUESTIONCOURSE without a quiz or questions, and some other activities Add a course QUESTIONONLYCOURSE with questions added to the question bank, but no quiz and some other activities A1. BACKUP QUIZCOURSE TEST: Backup QUIZCOURSE with default settings, question bank enabled VERIFY: Backup backs up correctly VERIFY: Course can be restored into a another Moodle correctly. Backup QUIZCOURSE without question bank unselected VERIFY: The quizes in the course can not be selected for backup VERIFY: Backup completes correctly VERIFY: if the backup is unzipped, no questions are included in the backup VERIFY: Course can be restored into a another Moodle correctly, without the quiz or questions A2. BACKUP NOQUESTIONCOURSE TEST: Backup NOQUESTIONCOURSE with default settings, question bank enabled VERIFY: Backup backs up correctly VERIFY: Course can be restored into a another Moodle correctly. Backup NOQUESTIONCOURSE without question bank unselected VERIFY: All activities are able to be backed up VERIFY: Backup completes correctly A3. BACKUP QUESTIONONLYCOURSE TEST: Backup QUESTIONONLYCOURSE with default settings, question bank enabled VERIFY: Backup backs up correctly VERIFY: Course can be restored into a another Moodle correctly. VERIFY: question bank is restored into new course Backup NOQUESTIONCOURSE without question bank unselected VERIFY: All activities are able to be backed up VERIFY: Backup completes correctly VERIFY: if the backup is unzipped, no questions are included in the backup VERIFY: Course can be restored into a another Moodle correctly, without questions B: Automated backups: Setup automated backups: Enable backup_auto_active Specify a directory in your automated backup setting Set backup_auto_skip_modif_days to Never Disable backup_auto_skip_modif_prev Now you need to run the automated backups with the 'Include question bank set to enabled in automated backup settings Enable backup_auto_questionbank Run the automated backups CLI tool: admin/cli/automated_backups.php VERIFY: the state of the backup files is the same as created in steps A1-A3 with question bank setting enabled Now run automated backups with 'Include question bank' set to enabled Disable backup_auto_questionbank Run the automated backups CLI tool: admin/cli/automated_backups.php VERIFY: the state of the backup files is the same as created in steps A1-A3 with question bank setting disabled. C: Import Create an empty course Go to course import Select the QUIZCOURSE to import frm Unselect 'include question bank' VERIFY: that you can't choose the quiz activity to import frm Select an activity which isn't the quiz to import VERIFY: that the activity imports correctly VERIFY: that the question bank remains empty Run the import again, this time selecting the question bank in settings Choose the quiz to import VERIFY: the quiz imports succesfully VERIFY: the questions are imported into the question bank D: Default settings In general backup default settings, disable question bank from the defaults Go to a course backup VERIFY: that 'include question bank' is default disabled [Note that if you try and enable it and backup that course it doens't work.. that is existing prob MDL-41923] E: Backup settings test Upgrade to lastest version Go to a course In your database: DELETE FROM mdl_config_plugins WHERE plugin = 'backup' and name like '%questionbank%'; Purge caches Go to backup a course (don't let moodle try and get you to set the config settings) VERIFY: that question bank is ticked in the settings Run automated backups cli script VERIFY: no errors are experienced
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_22_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-12403-master
    • Story Points (Obsolete):
      100
    • Sprint:
      BACKEND Sprint 5

      Description

      When making a backup of individual quizzes, no matter how many (or how few) quizzes I back up, the backup includes all questions from the question bank, not only those used in the quiz which I'm backing up. So, in an extreme case, if I back up a single quiz, and then restore it to another course, I unintentionally transfer hundreds of questions along with this quiz.

      The same happens when importing a quiz to another course.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  18/Nov/13