From 14e258a5d7955069fca75bcb43574fe6bf5b170b Mon Sep 17 00:00:00 2001 From: christianbeeznst Date: Wed, 26 Jun 2024 23:25:25 -0500 Subject: [PATCH] Exercise: Fix fill in the blanks results - refs BT#21822 --- public/main/exercise/exercise.class.php | 2 +- public/main/exercise/fill_blanks.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/main/exercise/exercise.class.php b/public/main/exercise/exercise.class.php index 8d0adc31d3b..94caf954633 100644 --- a/public/main/exercise/exercise.class.php +++ b/public/main/exercise/exercise.class.php @@ -4214,7 +4214,7 @@ public function manage_answer( $listMenu = FillBlanks::getFillTheBlankMenuAnswers($correctAnswer, false); if (!empty($studentAnswer)) { foreach ($listMenu as $key => $item) { - if ($key == $correctAnswer) { + if (sha1($item) === $studentAnswer) { $studentAnswerToShow = $item; break; } diff --git a/public/main/exercise/fill_blanks.class.php b/public/main/exercise/fill_blanks.class.php index 9e1d3b2014e..d0e361ad615 100644 --- a/public/main/exercise/fill_blanks.class.php +++ b/public/main/exercise/fill_blanks.class.php @@ -698,7 +698,7 @@ public static function isStudentAnswerGood($studentAnswer, $correctAnswer, $from $item = $listMenu[0]; if (!$fromDatabase) { $item = sha1($item); - $studentAnswer = sha1($studentAnswer); + //$studentAnswer = sha1($studentAnswer); } if ($item === $studentAnswer) { $result = true;