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

Components other than activity modules should be able to backup and restore question attempt data

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.8, 3.6.6, 3.7.2
    • Fix Version/s: 3.8
    • Component/s: Backup, Questions
    • Labels:
    • Testing Instructions:
      Hide

      CI tests will check this. And manual testing instructions @ MDL-66743 (that are a dupe of the ones originally here) will complete the testing indirectly.

      ---- ----
      Were:

      The new scenario added in mod/quiz/tests/behat/backup.feature should be sufficent to verify that this change has not caused any regressions for activity modules. If you want to do a manual test, find a quiz with some attempts, and make a backup and restore including user data.

      (If you really want to make the effort, you could also instal mod_studentquiz, and run all its auomated tests, or test its backup/restore manually. However this is probably overkill.)

      To test that the change allows other types of plugins to backup and restore question attempt data, run all the automated tests from the backup-restore branch of https://github.com/moodleou/moodle-report_embedquestion (which also requires filter_embedquestion installed). You will also need to have applied the fix from MDL-66743.

      This can be done with the following commands in the root of your Moodle workspace:

      git clone https://github.com/moodleou/moodle-filter_embedquestion.git filter/embedquestion/
      git clone -b backup-restore https://github.com/moodleou/moodle-report_embedquestion.git report/embedquestion/
      php admin/tool/phpunit/cli/init.php
      vendor/bin/phpunit --testsuite report_embedquestion_testsuite
      

      Show
      CI tests will check this. And manual testing instructions @ MDL-66743 (that are a dupe of the ones originally here) will complete the testing indirectly. ---- ---- Were: The new scenario added in mod/quiz/tests/behat/backup.feature should be sufficent to verify that this change has not caused any regressions for activity modules. If you want to do a manual test, find a quiz with some attempts, and make a backup and restore including user data. (If you really want to make the effort, you could also instal mod_studentquiz, and run all its auomated tests, or test its backup/restore manually. However this is probably overkill.) To test that the change allows other types of plugins to backup and restore question attempt data, run all the automated tests from the backup-restore branch of https://github.com/moodleou/moodle-report_embedquestion (which also requires filter_embedquestion installed). You will also need to have applied the fix from MDL-66743 . This can be done with the following commands in the root of your Moodle workspace: git clone https://github.com/moodleou/moodle-filter_embedquestion.git filter/embedquestion/ git clone -b backup-restore https://github.com/moodleou/moodle-report_embedquestion.git report/embedquestion/ php admin/tool/phpunit/cli/init.php vendor/bin/phpunit --testsuite report_embedquestion_testsuite
    • Affected Branches:
      MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:

      Description

      Currently, in backup and restore, there is a helper class abstract class backup_questions_activity_structure_step extends backup_activity_structure_step which is used by mod_quiz (and mod_studentquiz, etc.) to back up date that attempt data from when users interacted with questions.

      This is great if you are implementing an activity module. However, other types of plugin may use questions (e.g. filter_embedquestion + report_embedquestion), and they should be able to backup question attempt data too.

      Hopefully, this can be achieved with a small refactoring of the current code that is backwards-compatible.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                timhunt Tim Hunt
                Reporter:
                timhunt Tim Hunt
                Peer reviewer:
                Sam Marshall
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                CiBoT
                Participants:
                Component watchers:
                Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

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

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 10 minutes
                  1h 10m