From cd62c520e23cf122daaf9db2c2924055c9f35897 Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Fri, 20 Dec 2019 01:20:12 +1100 Subject: [PATCH] MDL-67151 qtype_numerical: convert the tolerance to string before saving Fix the sqlserver issue when saving a number into a text field --- question/type/numerical/questiontype.php | 1 + 1 file changed, 1 insertion(+) diff --git a/question/type/numerical/questiontype.php b/question/type/numerical/questiontype.php index 6f39b42e5ce..6e2a89a94c3 100644 --- a/question/type/numerical/questiontype.php +++ b/question/type/numerical/questiontype.php @@ -225,6 +225,7 @@ class qtype_numerical extends question_type { if ($options->tolerance === false) { $result->notice = get_string('invalidnumerictolerance', 'qtype_numerical'); } + $options->tolerance = (string)$options->tolerance; } if (isset($options->id)) { $DB->update_record('question_numerical', $options);