Open danmarsden opened 5 months ago
i think this is because of the newer PHP version that deprecates this feature so the PHP can be more stricter about typing. based on the implementation of said debug warning, this the code
$extraquestionfields = $this->extra_question_fields();
if (is_array($extraquestionfields)) {
// Omit table name.
array_shift($extraquestionfields);
foreach ($extraquestionfields as $field) {
$question->$field = $questiondata->options->$field;
}
}
but, because of this stricter type feature, based on this SO, i think moodle needs to add #[\AllowDynamicProperties]
decorator on their code base so the the warning not come up. And i think this is outside my plugin scope, because i'm just implementing the $this->extra_question_fields()
for the plugin. I might be wrong, because i don't really know about the moodle code base really well. Let me know if you need discussion
nah - you need to fix your base question class - here's an example of a commit from a core question type that I think fixes this particular issue for that qtype: https://github.com/moodle/moodle/commit/e8d5dc93e08410a0fb98b7136b0554988bda9081
another example: https://github.com/moodle/moodle/commit/d84389391cd5616b231d13796ce0e12645f6cfb9
there are probably better examples best suited to your specific case though.
(probably related to new version of PHP)
Deprecated: Creation of dynamic property qtype_essaysimilarity_question::$showfeedback is deprecated in /home/dan/www/moodle/question/type/questiontypebase.php on line 1015
Deprecated: Creation of dynamic property qtype_essaysimilarity_question::$answerkey is deprecated in /home/dan/www/moodle/question/type/questiontypebase.php on line 1015
Deprecated: Creation of dynamic property qtype_essaysimilarity_question::$answerkeyformat is deprecated in /home/dan/www/moodle/question/type/questiontypebase.php on line 1015
Deprecated: Creation of dynamic property qtype_essaysimilarity_question::$showanswerkey is deprecated in /home/dan/www/moodle/question/type/questiontypebase.php on line 1015
Deprecated: Creation of dynamic property qtype_essaysimilarity_question::$showtextstats is deprecated in /home/dan/www/moodle/question/type/questiontypebase.php on line 1015
Deprecated: Creation of dynamic property qtype_essaysimilarity_question::$textstatitems is deprecated in /home/dan/www/moodle/question/type/questiontypebase.php on line 1015
Deprecated: Creation of dynamic property qtype_essaysimilarity_question::$questionlanguage is deprecated in /home/dan/www/moodle/question/type/questiontypebase.php on line 1015
Deprecated: Creation of dynamic property qtype_essaysimilarity_question::$upper_correctness is deprecated in /home/dan/www/moodle/question/type/questiontypebase.php on line 1015
Deprecated: Creation of dynamic property qtype_essaysimilarity_question::$lower_correctness is deprecated in /home/dan/www/moodle/question/type/questiontypebase.php on line 1015