diff --git a/src/main/java/org/olat/ims/qti21/model/statistics/TextEntryInteractionStatistics.java b/src/main/java/org/olat/ims/qti21/model/statistics/TextEntryInteractionStatistics.java
index c5a70d392295de274aee2f4f133e845de9e95cca..148768d462024e31b0bf548c9ef17b25d3303677 100644
--- a/src/main/java/org/olat/ims/qti21/model/statistics/TextEntryInteractionStatistics.java
+++ b/src/main/java/org/olat/ims/qti21/model/statistics/TextEntryInteractionStatistics.java
@@ -65,10 +65,12 @@ public class TextEntryInteractionStatistics extends AbstractTextEntryInteraction
 		if((value1 != null && value1.isEmpty()) && (value2 == null || value2.isEmpty())) return true;
 		
 		if(caseSensitive) {
-			if(value1.equals(value2)) {
+			if(value1.equals(value2)
+					|| (value2 != null && value1.trim().equals(value2.trim()))) {
 				return true;
 			}
-		} else if(value1.equalsIgnoreCase(value2)) {
+		} else if(value1.equalsIgnoreCase(value2)
+				|| (value2 != null && value1.trim().equalsIgnoreCase(value2.trim()))) {
 			return true;
 		}
 		return false;
diff --git a/src/main/java/org/olat/ims/qti21/model/xml/interactions/FIBAssessmentItemBuilder.java b/src/main/java/org/olat/ims/qti21/model/xml/interactions/FIBAssessmentItemBuilder.java
index 0a37fc34810576c14ad3174afd63f89e01e33119..59d41453b5d9ed2f079b44aef3e3492039b64e14 100644
--- a/src/main/java/org/olat/ims/qti21/model/xml/interactions/FIBAssessmentItemBuilder.java
+++ b/src/main/java/org/olat/ims/qti21/model/xml/interactions/FIBAssessmentItemBuilder.java
@@ -1098,6 +1098,7 @@ public class FIBAssessmentItemBuilder extends AssessmentItemBuilder {
 		 * @param response
 		 * @return
 		 */
+		@Override
 		public boolean match(String response) {
 			if(match(response, solution)) {
 				return true;
@@ -1113,10 +1114,12 @@ public class FIBAssessmentItemBuilder extends AssessmentItemBuilder {
 
 		private boolean match(String response, String alternative) {
 			if(caseSensitive) {
-				if(alternative.equals(response)) {
+				if(alternative.equals(response)
+						|| (response != null && alternative.trim().equals(response.trim()))) {
 					return true;
 				}
-			} else if(alternative.equalsIgnoreCase(response)) {
+			} else if(alternative.equalsIgnoreCase(response)
+					|| (response != null && alternative.trim().equalsIgnoreCase(response.trim()))) {
 				return true;
 			}
 			return false;
diff --git a/src/test/java/org/olat/ims/qti21/statistics/TextEntryInteractionStatisticsTest.java b/src/test/java/org/olat/ims/qti21/statistics/TextEntryInteractionStatisticsTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..91cbefb555a3ec488b9af3133c3a9066dc21aecf
--- /dev/null
+++ b/src/test/java/org/olat/ims/qti21/statistics/TextEntryInteractionStatisticsTest.java
@@ -0,0 +1,106 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.ims.qti21.statistics;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+import org.olat.ims.qti21.model.statistics.TextEntryInteractionStatistics;
+import org.olat.ims.qti21.model.xml.interactions.FIBAssessmentItemBuilder.TextEntry;
+import org.olat.ims.qti21.model.xml.interactions.FIBAssessmentItemBuilder.TextEntryAlternative;
+
+import uk.ac.ed.ph.jqtiplus.types.Identifier;
+
+/**
+ * Test the OpenOLAT implementation of match() / or Mapping (in QtiWorks)
+ * for textEntryInteraction.
+ * 
+ * Initial date: 15 févr. 2019<br>
+ * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
+ *
+ */
+@RunWith(Parameterized.class)
+public class TextEntryInteractionStatisticsTest {
+	
+	@Parameters
+    public static Collection<Object[]> data() {
+        return Arrays.asList(new Object[][] {
+            { true, "+bremsen()", Collections.singletonList("+ bremsen()"), "+bremsen()", true },
+            { true, "+bremsen()", Collections.singletonList("+ bremsen()"), " +bremsen()", true },
+            { true, "+bremsen()", Collections.singletonList("+ bremsen()"), " +bremsen ()", false },
+            { false, "+bremsen()", Collections.singletonList("+ bremsen()"), " +Bremsen ()", false },
+            { false, "+bremsen()", Collections.singletonList("+ bremsen()"), " +breMSen()", true },
+            { false, "+bremsen()", Collections.singletonList("+ bremsen()"), " +BREMSEN() ", true },
+            { false, "+bremsen()", Collections.singletonList("+ bremsen()"), " + BREMSEN() ", true },
+            { false, "+bremsen()", Collections.singletonList("+ bremsen()"), "bremsen", false },
+            { false, "+bremsen()", Collections.singletonList("+ bremsen()"), "bremsen()", false },
+            { false, "+bremsen()", Collections.singletonList("+ bremsen()"), "-bremsen()", false }
+        });
+    }
+	
+	private boolean caseSensitive;
+	private String correctResponse;
+	private List<String> alternatives;
+	private String response;
+	private boolean match;
+	
+	public TextEntryInteractionStatisticsTest(boolean caseSensitive, String correctResponse, List<String> alternatives, String response, boolean match) {
+		this.caseSensitive = caseSensitive;
+		this.correctResponse = correctResponse;
+		this.alternatives = alternatives;
+		this.response = response;
+		this.match = match;	
+	}
+	
+	@Test
+	public void matchStatistics() {
+		TextEntryInteractionStatistics textEntryStats = new TextEntryInteractionStatistics(null,
+				caseSensitive, correctResponse, alternatives, 1.0d);
+		boolean hasMatched = textEntryStats.matchResponse(response);
+		Assert.assertEquals(match, hasMatched);
+	}
+	
+	@Test
+	public void matchBuilder() {
+		TextEntry textEntry = new TextEntry(Identifier.assumedLegal("textentry"));
+		textEntry.setSolution(correctResponse);
+		
+		List<TextEntryAlternative> textEntryAlternatives = new ArrayList<>();
+		for(String alt:alternatives) {
+			TextEntryAlternative alternative = new TextEntryAlternative();
+			alternative.setAlternative(alt);
+			textEntryAlternatives.add(alternative);
+		}
+		
+		textEntry.setAlternatives(textEntryAlternatives);
+		textEntry.setCaseSensitive(caseSensitive);
+		boolean hasMatched = textEntry.match(response);
+		Assert.assertEquals(match, hasMatched);
+	}
+
+}
diff --git a/src/test/java/org/olat/test/AllTestsJunit4.java b/src/test/java/org/olat/test/AllTestsJunit4.java
index af0400ec34c6d3178d6dfac909d0f888b189c190..d4f2e000aa22a330916bcd36de5b1bd51ceed8e2 100644
--- a/src/test/java/org/olat/test/AllTestsJunit4.java
+++ b/src/test/java/org/olat/test/AllTestsJunit4.java
@@ -250,10 +250,12 @@ import org.junit.runners.Suite;
 	org.olat.ims.qti21.model.xml.AssessmentHtmlBuilderTest.class,
 	org.olat.ims.qti21.model.xml.AssessmentItemPackageTest.class,
 	org.olat.ims.qti21.model.xml.ManifestPackageTest.class,
+	org.olat.ims.qti21.model.xml.interactions.FIBAssessmentItemBuilderTextEntryTest.class,
 	org.olat.ims.qti21.pool.QTI12To21ConverterTest.class,
 	org.olat.ims.qti21.pool.QTI12To21HtmlHandlerTest.class,
 	org.olat.ims.qti21.pool.QTI21QPoolServiceProviderTest.class,
 	org.olat.ims.qti21.repository.handlers.QTI21AssessmentTestHandlerTest.class,
+	org.olat.ims.qti21.statistics.TextEntryInteractionStatisticsTest.class,
 	org.olat.ims.qti21.model.xml.Onyx38ToQtiWorksAssessementItemsTest.class,
 	org.olat.ims.qti21.model.xml.OnyxToQtiWorksAssessementItemsTest.class,
 	org.olat.ims.qti21.model.xml.OnyxToQtiWorksAssessementTestsTest.class,