From c87f10986aca7b869131a6fad66a0e40fdab99fb Mon Sep 17 00:00:00 2001 From: Shady Sherif Date: Tue, 7 May 2024 16:56:24 +0100 Subject: [PATCH] Resolve compatibility issues moodle 4.3.3+ --- mod_form.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mod_form.php b/mod_form.php index 054af0b..2d0aaa3 100755 --- a/mod_form.php +++ b/mod_form.php @@ -136,7 +136,11 @@ function definition() { - $quizLen = count($quizzes_questionNames[$firstQuizId]->questionDetails); + if ($quizzes_questionNames[$firstQuizId]->questionDetails !== null) { + $quizLen = count($quizzes_questionNames[$firstQuizId]->questionDetails); + } else { + $quizLen = 0; + } $mform->addElement('html', '
'); @@ -156,7 +160,7 @@ function definition() { $urlParams .= isset($question_id) && $question_id != null ? "question_id=$question_id" : ""; - $tilesEditor[] = $mform->createElement(html, ' + $tilesEditor[] = $mform->createElement('html', ' '); @@ -381,4 +385,4 @@ function removeURLParameter(url, parameter) { $this->add_action_buttons(); } -} \ No newline at end of file +}