Skip to content

Make changes needed after the fix of MDL-83541 #74

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

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

Conversation

PhilippImhof
Copy link

With the fix of MDL-83541, Moodle will calculate a hash of all relevant fields of a question and its answers during the restore process. This allows to avoid duplicating questions during imports while still being able to distinguish different questions with the same "stamp".

This PR makes the necessary changes.

It can be tested using the mod/quiz/tests/backup/repeated_restore_test.php unit tests in Moodle 4.5 and upcoming 5.0. You may want to tweak the test a bit by changing its get_qtype_generators() data provider and adding

$generators = [
            ['pmatch', 'listen'],
            ['pmatch', 'frogtoad'],
            ['pmatch', 'spanish'],
        ];

at the end, in order to just check this question type (instead of all installed types) and to make sure it uses the three questions with a get_pmatch_question_form_data_* method, instead of just the first one that can be found.

With the fix of MDL-83541, Moodle will calculate a hash of all relevant fields of a question and its answers during the restore process. This allows to avoid duplicating questions during imports while still being able to distinguish different questions with the same "stamp".
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