marcusgreen / moodle-qtype_gapfill

Fill in the blanks question type with very easy to learn syntax
6 stars 20 forks source link

TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int #113

Open aspark21 opened 7 months ago

aspark21 commented 7 months ago

PHP8.1 Moodle 4.3 stable

New PHPUnit failures since Thursday. Seems it could be due to the core weekly release rather than the plugin update

qtype_gapfill.walkthrough_test/test_draggable_itemsqtype_gapfill\walkthrough_test::test_draggable_items 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int 
/var/www/html/question/classes/output/question_version_info.php:62 
/var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 
/var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 
/var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 
/var/www/html/question/engine/tests/helpers.php:986 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:61 
/var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_dropdownsqtype_gapfill\walkthrough_test::test_dropdowns TypeError: Cannot assign string to 
property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 
/var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 
/var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 
/var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:97 
/var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_deferred_feedback_unansweredqtype_gapfill\walkthrough_test::test_deferred_feedback_unanswered 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 
/var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 
/var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 
/var/www/html/question/engine/questionusage.php:483
/var/www/html/question/engine/tests/helpers.php:921 
/var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:123 
/var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_interactive_with_correctqtype_gapfill\walkthrough_test::test_interactive_with_correct 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 /var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:316 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_interactive_wildcard_with_correctqtype_gapfill\walkthrough_test::test_interactive_wildcard_with_correct 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 /var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:366 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_interactive_discard_duplicatesqtype_gapfill\walkthrough_test::test_interactive_discard_duplicates 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 /var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:480 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_interactive_grade_for_blankqtype_gapfill\walkthrough_test::test_interactive_grade_for_blank 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 /var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:570 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_matching_divsqtype_gapfill\walkthrough_test::test_matching_divs 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:616 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_get_aftergap_textqtype_gapfill\walkthrough_test::test_get_aftergap_text 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:642 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81

qtype_gapfill.walkthrough_test/test_deferred_grade_for_blankqtype_gapfill\walkthrough_test::test_deferred_grade_for_blank 
TypeError: Cannot assign string to property core_question\output\question_version_info::$version of type int  
/var/www/html/question/classes/output/question_version_info.php:62 /var/www/html/question/engine/renderer.php:150 
/var/www/html/question/engine/renderer.php:102 /var/www/html/question/behaviour/behaviourbase.php:113 
/var/www/html/question/engine/questionattempt.php:912 /var/www/html/question/engine/questionusage.php:483 
/var/www/html/question/engine/tests/helpers.php:921 /var/www/html/question/engine/tests/helpers.php:1012 
/var/www/html/question/type/gapfill/tests/walkthrough_test.php:688 /var/www/html/lib/phpunit/classes/advanced_testcase.php:81
marcusgreen commented 7 months ago

Interesting, I will investigate

aspark21 commented 7 months ago

Found this where it was fixed in core: https://tracker.moodle.org/browse/MDL-79507 https://github.com/moodle/moodle/commit/f462a48202507f61ce44b8ee0030ce47c1fbbbd8

aspark21 commented 7 months ago

Quite likely to be due to this change https://tracker.moodle.org/browse/MDL-80087 https://github.com/moodle/moodle/commit/b7a7263c17e2006d3873c8ece28ea2ba277abf86

not that it helps with what a fix might look like

marcusgreen commented 7 months ago

I suspect it is a test failure rather than a plugin failure, but I am keen all my tests pass

aspark21 commented 7 months ago

full test run has now completed with MDL-80087 reverted and this resolves those failing tests, so that's definitely where it's coming from

marcusgreen commented 7 months ago

Hi Alistair, I am not entirely sure why the unit tests ever worked under PHP 8.2. However as a result of his commit https://github.com/marcusgreen/moodle-qtype_gapfill/commit/69988aa31345ed9f9ca57ac02a4b4443b0f91ad7 They now work as expected on the CI. Can you confirm it works for you

aspark21 commented 7 months ago

Thanks Marcus!

Tests running now, results should be in in about 3.5h.