Skip to content

Conversation

@marxjohnson
Copy link
Contributor

This describes the required updates to qtype plugins following to implementation of MDL-83541 to avoid duplication of questions during restores.

@netlify
Copy link

netlify bot commented Mar 6, 2025

Deploy Preview for moodledevdocs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1c474db
🔍 Latest deploy log https://app.netlify.com/sites/moodledevdocs/deploys/67d788c2e526880008a9c692
😎 Deploy Preview https://deploy-preview-1280--moodledevdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@marxjohnson marxjohnson force-pushed the MDL-83541-qtype-restore-changes branch 3 times, most recently from e75d180 to 5722e90 Compare March 6, 2025 14:50
@timhunt
Copy link
Collaborator

timhunt commented Mar 6, 2025

Thanks Mark. That looks like a really good new docs page.

The only bit I don't really like is the use of $name for the plugin name. Is this a convention used elsewhere in the docs? I managed to avoid it comletely on https://moodledev.io/docs/5.0/apis/plugintypes/qtype/newquestiondefaults. On https://moodledev.io/docs/5.0/apis/plugintypes/qbank/filters we use qbank_myplugin. Up to you to make a final call.

@andrewnicols
Copy link
Member

I'd also second not making this a var. Another option would be to use a placeholder:

In your  `restore_qtype_<name>_plugin`  class, add an override of the `remove_excluded_question_data()` method, which removes this

@timhunt
Copy link
Collaborator

timhunt commented Mar 7, 2025

I like Andrew's suggestion. Feel free to updated qbank/filters while you are at it Mark (he suggested cheekily :-))

@marxjohnson marxjohnson force-pushed the MDL-83541-qtype-restore-changes branch from 5722e90 to 9b6f5e6 Compare March 7, 2025 10:32
@sarjona sarjona added the blocked-by-tracker This issue is blocked by an issue in https://tracker.moodle.org/ label Mar 11, 2025
@HuongNV13
Copy link
Member

Thanks, Mark
It looks good to me

@HuongNV13
Copy link
Member

I have rebased the branch, and the failures are gone!

@HuongNV13 HuongNV13 added this pull request to the merge queue Mar 17, 2025
Merged via the queue into moodle:main with commit a972392 Mar 17, 2025
6 checks passed
@binhdv1983
Copy link

Hi @marxjohnson,

We’ve developed three new question types, and when I run the unit test located at mod/quiz/tests/backup/repeated_restore_test.php, no errors are reported — even though we added an additional path to the $paths[] array in the define_question_plugin_structure() method.

My question is: should we still apply the changes described in this documentation, even if no errors are currently detected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-by-tracker This issue is blocked by an issue in https://tracker.moodle.org/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants