From f42c7c061cc7ff5b2611912ffba9e6c2f160c7c2 Mon Sep 17 00:00:00 2001 From: Pol Torrent i Soler Date: Mon, 4 Nov 2024 12:32:50 +0100 Subject: [PATCH 1/3] fix: prevent warning when creating new questions by adding a null check Kanbanize: #taskid 51492 --- edit_multianswerwiris_form.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/edit_multianswerwiris_form.php b/edit_multianswerwiris_form.php index 5b90889..c760b77 100644 --- a/edit_multianswerwiris_form.php +++ b/edit_multianswerwiris_form.php @@ -51,10 +51,12 @@ class qtype_multianswer_edit_form_helper extends qtype_multianswer_edit_form { protected function definition_inner($mform) { // Remove wiris particle from subquestion qtypes so the multianswer form does not think // we are changing the qtypes when we are not actually doing it. - foreach ($this->savedquestiondisplay->options->questions as $subq) { - $qtype = $subq->qtype; - if (substr($qtype, -5) == 'wiris') { - $subq->qtype = substr($qtype, 0, strlen($qtype) - 5); + if (isset($this->savedquestiondisplay)) { + foreach ($this->savedquestiondisplay->options->questions as $subq) { + $qtype = $subq->qtype; + if (substr($qtype, -5) == 'wiris') { + $subq->qtype = substr($qtype, 0, strlen($qtype) - 5); + } } } From c54593d667cfa973f5950e97e81507302cb1b714 Mon Sep 17 00:00:00 2001 From: Pol Torrent i Soler Date: Mon, 4 Nov 2024 12:33:42 +0100 Subject: [PATCH 2/3] feat: report exception when notifying failure of attempt grading Kanbanize: #taskid 51138 --- question.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/question.php b/question.php index bb8fd29..0dc88b6 100644 --- a/question.php +++ b/question.php @@ -240,7 +240,7 @@ private function set_shortanswer_matching_answers(array $response) { $this->step->reset_attempts(); } catch (moodle_exception $e) { // Notify of the error. - $this->step->inc_attempts(); + $this->step->inc_attempts($e); throw $e; } } From 1c55a49e5b1c98b87a9dbf3af0df866493761f84 Mon Sep 17 00:00:00 2001 From: Pol Torrent i Soler Date: Mon, 4 Nov 2024 12:34:18 +0100 Subject: [PATCH 3/3] chore: bump version to 4.11.5 --- version.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/version.php b/version.php index 0cf8a02..4552371 100644 --- a/version.php +++ b/version.php @@ -16,11 +16,11 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2024032204; +$plugin->version = 2024032205; $plugin->requires = 2015111600; // Moodle 3.0. -$plugin->release = '4.11.4'; +$plugin->release = '4.11.5'; $plugin->maturity = MATURITY_STABLE; $plugin->component = 'qtype_multianswerwiris'; $plugin->dependencies = array( - 'qtype_wq' => 2024032204 + 'qtype_wq' => 2024032205 );