-
Notifications
You must be signed in to change notification settings - Fork 41
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
Point rules / level descriptions not working properly on course backup / restore #154
Comments
Thank you @tsbartel for reporting this. I'm actually glad you identified the issue, we were aware that at times rule were duplicated but did not know when, or how. It turns out it's to do with merging restores, so thank you! We patched the bug and included a bunch of unit tests to validate that the behaviour, as we had to manually delete the entries it was important to validate that the deletion works, but only when it should. We've also patched the restore code to always prevent multiple grade rules. This work has also highlighted potential issues with the restore of XP+, which works slightly differently as it is a local plugin. We will document the behaviour in our documentation, but please note that a merge restore (with or witout delete) will never restore XP+ data if the setting "Overwrite course configuration" is not set to "Yes", and it unfortunately defaults to "No". The reason being that Moodle does not invoke local plugins (and others) during course restore if this setting is disabled. I'm not entirely sure why that is. Thanks again for reporting this! |
You're very welcome and I'm very thankful for you being on top of this issue so fast. Our institution is very content with the xp plugin suite and I want to extend our thanks to you and the other maintainers for providing a great gamification subsystem for Moodle. Cheers from Germany |
You have a point, perhaps it would best if block_xp was responsible for backup and restores, deferring to local_xp where needed. It does something along those lines for the privacy API, so perhaps backups could work the same way. Having said that, the backup code is a mysterious jungle and I don't want to get ahead of myself assuming it is easily possible. Thanks a lot for your kind words! XP is 9 years old now, who would have thought? Not me! :-) |
When restoring a course with block_xp configuration into an existing course (selecting "Restore into this course" -> "Delete the contents of this course and then restore"), the information on point rules is duplicated. More precisely: The point rules (both grade & event) from the backup file are added to the ruleset of the existing course.
Repeated restoration attempts of a course can cause very bloated rulesets which is especially annoying with the grade rulesets as these cannot be manually deleted.
Minimal course backup file for demonstration:
backup-moodle2-course-65-testcourse_xp-20230412-1758-nu.mbz
(Moodle 3.9.20, block_xp 3.13.3, local_xp 1.13.1)
Steps to reproduce:
a. Restore into this course
b. Delete the contents of this course and then restore
Optional steps:
2.5 Make some arbitrary changes to the ruleset before restoring to make the new ruleset distinguishably from the old ruleset.
5. Repeat the process multiple times to observe linear growth of the ruleset with each restore.
The text was updated successfully, but these errors were encountered: