-
Notifications
You must be signed in to change notification settings - Fork 8
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_quizgame: Add Backup / Restore support #33
Conversation
Thanks @sbourget. Unfortunately I'm getting
|
Fix debugging notice
Thanks @xow. I just added a commit to fix that. Could you take another look? |
Unfortunately seems to error out when you attempt to restore to a different course (because the question bank is not available there maybe?)
|
Any chance you can post a copy of the backup file? I cannot reproduce the issue here (MacOS / My SQL) I've been able to create the backup, delete the original course including the question category & questions, then restore the backup creating a new course. I've been able to play the game successfully in this new course accessing all of the original questions. What context are your questions / question categories in (course / category/ or system?) |
Improve logic for mapping to the question bank.
I was finally able to reproduce the issue and have added a fix. It seems sometimes the questioncategory field is just holding the ID, while other times it is holding the id,context for the corresponding category in the question bank. I've added logic to the restore code to check to see what we are working with, and then to handle it appropriately. |
Thanks @sbourget for fixing that! Unfortunately now I get the following error
|
@xow, I'm a bit confused on that error. What options are you using when creating the backup? Are you backing up the whole course or just the activity? |
Just the activity on the front page... must be a bit of an edge case! |
@xow, Not sure if there is much I can do in that scenario. I've added some additional logging, but it seems activity backups MAY not include everything we would need to restore the instance. (for example, If you select a question category that is assigned to the course context or higher and perform the activity only backup, the question category is not actually included in the backup, even though the dependency is marked. This seems to be an issue with moodle core, and I'm not sure how to even approach trying to fix that) How would you suggest I proceed from here? |
Thanks @sbourget. I tried course restore and had the same error (or similar) However I thought it would be worth merging this even if it's not perfect (especially if it's a core problem). Because at least in most cases it will work. Thanks again! |
Proposed patch adds backup / restore support to mod_quizgame.
Fixes issue #31