Skip to content

Fix side effects of question duplication bug patch #253

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

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

ngandrass
Copy link
Contributor

I did some testing and 59cda8c seems to introduce side effects that make mod/quiz/tests/backup/repeated_restore_test.php fail.


Before 59cda8c:

/usr/share/nginx/www/moodle $ php vendor/bin/phpunit --color mod/quiz/tests/backup/repeated_restore_test.php
Moodle 4.5.3 (Build: 20250317), d069cb93378d39ee00ce5f30cc520aaee4ae496c
Php: 8.3.19, pgsql: 14.17, OS: Linux 6.13.8-arch1-1 x86_64
PHPUnit 9.6.18 by Sebastian Bergmann and contributors.

.....SSSS.SS..SS...S.S..................S....................S.  63 / 115 ( 54%)
.....SSSS.SS..SS...S.S....S..S.SS.S.....S..S........            115 / 115 (100%)

Time: 00:56.384, Memory: 72.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 115, Assertions: 232, Skipped: 29.

After 59cda8c:

/usr/share/nginx/www/moodle $ php vendor/bin/phpunit --color mod/quiz/tests/backup/repeated_restore_test.php
Moodle 4.5.3 (Build: 20250317), d069cb93378d39ee00ce5f30cc520aaee4ae496c
Php: 8.3.19, pgsql: 14.17, OS: Linux 6.13.8-arch1-1 x86_64
PHPUnit 9.6.18 by Sebastian Bergmann and contributors.

.....SSSS.SS..SS...S.S..................S....................S.  63 / 115 ( 54%)
..EEESSSSESSEESSEEESESEEEESEESESSESEEEEESEESEEEEEEEE            115 / 115 (100%)

Time: 00:43.563, Memory: 70.00 MB

The cause was:

Undefined array key "coderunner_testcases"

/usr/share/nginx/www/moodle/question/type/coderunner/backup/moodle2/restore_qtype_coderunner_plugin.class.php:154

Therefore a check for this is added to the respective function.

…o_questiondata() on mod/quiz/tests/backup/repeated_restore_test.php
@trampgeek trampgeek merged commit ea218fc into trampgeek:development Apr 10, 2025
1 of 3 checks passed
@trampgeek
Copy link
Owner

Thanks Niels.

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.

2 participants