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

Quiz entering question IDs into backup_ids table before the backup has been executed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.5
    • Component/s: Backup, Quiz
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      I discovered this issue when using the backup_course_silently() function from /backup/lib.php.

      The standard function quiz_check_backup_mods() from /mod/quiz/backuplib.php is actually storing question and question category IDs into the 'backup_ids' table before the backup has been executed.

      The MODNAME_check_backup_mods() functions are never called during the backup_generate_preferences_artificially() function used when silently creating a backup as those standard functions seem to only be used when displaying a list of modules for inclusion / exclusion before beginning the standard backup process.

      The quiz module is actually performing actions which, if not done, means that no questions or question categories are stored in the backup and if that backup is used to restore the course, any quizzes in that course will have no questions in them and none available to add to quizzes.

      It seems to me like this is a bug but I haven't dug around enough into the quiz and question backup code to determine if this is something that could be considered a "necessary hack". An obvious solution is to update the backup_preferences_artificially() function but it seems to me like the quiz code is just performing backup actions in a function only meant to gather data for display in a form.

        Attachments

          Activity

            People

            • Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              jfilip Justin Filip
              Participants:
              Component watchers:
              Adrian Greeve, Mihail Geshoski, Peter Dias, Tim Hunt, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

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