From 4c525916f94ece1a0aa8264e556b8da0d11b5a56 Mon Sep 17 00:00:00 2001 From: Leon Stringer Date: Thu, 18 Jul 2024 16:33:12 +0100 Subject: [PATCH] 11 Fix Unknown format passed to format_text: html The test helper previously used 'html' for the format passed to format_text(). This expects a FORMAT_ constant but prior to Moodle 4.4 defaulted to FORMAT_MOODLE for unrecognised values. It now throws an exception for such values (MDL-80072). This change uses FORMAT_HTML instead. --- tests/helper.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/helper.php b/tests/helper.php index b5b7d0f..1f71dd3 100644 --- a/tests/helper.php +++ b/tests/helper.php @@ -54,7 +54,7 @@ public function make_varnumunit_question_3_sig_figs_with_m_unit() { '12345', // Answer. '1', // Fraction. '

Your answer is correct.

', // Feedback. - 'html', // Feedbackformat. + FORMAT_HTML, // Feedbackformat. '3', // Sigfigs. '', // Error. '0.1', // Syserrorpenalty. @@ -68,7 +68,7 @@ public function make_varnumunit_question_3_sig_figs_with_m_unit() { '*', // Answer. '0', // Fraction. '

Your answer is incorrect.

', // Feedback. - 'html', // Feedbackformat. + FORMAT_HTML, // Feedbackformat. '0', // Sigfigs. '', // Error. '0.1000000', // Syserrorpenalty. @@ -125,7 +125,7 @@ public function make_varnumunit_question_3_sig_figs_with_units_meters_per_second '4000', // Answer. '1', // Fraction. '

Your answer is correct.

', // Feedback. - 'html', // Feedbackformat. + FORMAT_HTML, // Feedbackformat. '4', // Sigfigs. '', // Error. '0.1000000', // Syserrorpenalty. @@ -139,7 +139,7 @@ public function make_varnumunit_question_3_sig_figs_with_units_meters_per_second '*', // Answer. '0', // Fraction. '

Your answer is incorrect.

', // Feedback. - 'html', // Feedbackformat. + FORMAT_HTML, // Feedbackformat. '0', // Sigfigs. '', // Error. '0.1000000', // Syserrorpenalty. @@ -206,7 +206,7 @@ public function make_varnumunit_question_simple_1_m() { '1', // Answer. '1', // Fraction. '

Your answer is correct.

', // Feedback. - 'html', // Feedbackformat. + FORMAT_HTML, // Feedbackformat. '0', // Sigfigs. '', // Error. '0.1000000', // Syserrorpenalty.