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

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.8
    • 3.5.8, 3.6.6, 3.7.2
    • Backup, Questions
    • MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
    • MOODLE_38_STABLE
    • 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

      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.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Sam Marshall Sam Marshall
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.