Skip to content

[#39] Add de-duplication code for restore with no options - #45

Open
marxjohnson wants to merge 1 commit into
ecampbell:masterfrom
marxjohnson:39-restore-fix
Open

[#39] Add de-duplication code for restore with no options#45
marxjohnson wants to merge 1 commit into
ecampbell:masterfrom
marxjohnson:39-restore-fix

Conversation

@marxjohnson

Copy link
Copy Markdown

If we end up restoring a question from a backup that had its original options record deleted, it will duplicate that question. This fix ensures that such a question will use defaults provided by get_default_options() to correctly match it with the original question, avoiding duplication.

This is largely copied from the same functionality added to qtype_multichoice for MDL-85721.

The existing create_default_options() function relied on some plugin config for some of the default values, but there doesn't appear to be a way to set these config settings, so I have replaced them with hard-coded values.

If we end up restoring a question from a backup that had its original
options record deleted, it will duplicate that question. This fix
ensures that such a question will use defaults provided by
`get_default_options()` to correctly match it with the original
question, avoiding duplication.

This is largely copied from the same functionality added to
qtype_multichoice for MDL-85721.

The existing create_default_options() function relied on some plugin
config for some of the default values, but there doesn't appear to be a
way to set these config settings, so I have replaced them with
hard-coded values.
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