diff --git a/src/qtism/runtime/expressions/MapResponseProcessor.php b/src/qtism/runtime/expressions/MapResponseProcessor.php
index ab9a1851c..cba91e9d8 100644
--- a/src/qtism/runtime/expressions/MapResponseProcessor.php
+++ b/src/qtism/runtime/expressions/MapResponseProcessor.php
@@ -117,13 +117,13 @@ public function process()
for ($i = 0; $i < count($mapEntries); $i++) {
$mapKey = $rawMapKey = $mapEntries[$i]->getMapKey();
-
+ $processedVal = null;
if ($val instanceof QtiString && $mapEntries[$i]->isCaseSensitive() === false) {
- $val = mb_strtolower($val->getValue(), 'UTF-8');
+ $processedVal = mb_strtolower($val->getValue(), 'UTF-8');
$mapKey = mb_strtolower($mapKey, 'UTF-8');
}
- if (($val instanceof Comparable && $val->equals($mapKey) === true) || $val === $mapKey) {
+ if (($val instanceof Comparable && $val->equals($mapKey) === true) || $processedVal === $mapKey) {
if (in_array($rawMapKey, $mapped, true) === false) {
$result += $mapEntries[$i]->getMappedValue();
$mapped[] = $rawMapKey;
diff --git a/test/qtismtest/runtime/expressions/MapResponseProcessorTest.php b/test/qtismtest/runtime/expressions/MapResponseProcessorTest.php
index 466bf8a7b..0312df455 100644
--- a/test/qtismtest/runtime/expressions/MapResponseProcessorTest.php
+++ b/test/qtismtest/runtime/expressions/MapResponseProcessorTest.php
@@ -143,8 +143,8 @@ public function testMultipleCardinalityIdentifierToFloat() {
Choice7
-
-
+
+