Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_studentquiz: Fix duplicated question categories in course backup #513

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tonyjbutler
Copy link

@tonyjbutler tonyjbutler commented Dec 2, 2024

I still need to work out how to reproduce the issue manually, without sharing any of our real course backups, but under certain conditions we have found that backups of courses containing mod_studentquiz instances will result in all question categories in the course being duplicated on restore (the duplicates can be seen in the .mbz file).

Debugging has shown that additional course contexts are being included during the calculation of question categories to be included in the backup, and these seem to be the contexts of courses that also include usages of some of the same questions used in the mod_studentquiz instance.

The only reliable way to prevent this seems to be to include the step new backup_delete_temp_questions('clean_temp_questions') in backup/moodle2/backup_studentquiz_activity_task.class.php, however it must be included before the step new backup_calculate_question_categories('activity_question_categories'), unlike in the core mod_quiz activity where it comes after it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant