From 363b3dfd59f306a836d56c9e8a2f4d48a7f1b6e3 Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Fri, 4 Oct 2013 15:41:58 +0200
Subject: [PATCH] OO-533: fix correct answer cut within a IE's conditional
 comment which break the whole layout

---
 src/main/java/org/olat/ims/qti/QTI12MetadataController.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/olat/ims/qti/QTI12MetadataController.java b/src/main/java/org/olat/ims/qti/QTI12MetadataController.java
index a7d3702bb27..726a4f06ba1 100644
--- a/src/main/java/org/olat/ims/qti/QTI12MetadataController.java
+++ b/src/main/java/org/olat/ims/qti/QTI12MetadataController.java
@@ -29,6 +29,7 @@ import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.core.util.Util;
+import org.olat.core.util.filter.impl.NekoHTMLFilter;
 import org.olat.ims.qti.editor.ItemNodeTabbedFormController;
 import org.olat.ims.qti.editor.QTIEditHelper;
 import org.olat.ims.qti.editor.beecom.objects.ChoiceQuestion;
@@ -105,7 +106,10 @@ public class QTI12MetadataController extends FormBasicController  {
 					if(correct && response.getContent() != null) {
 						String responseSummary = response.getContent().renderAsText();
 						if(responseSummary.length() > 128) {
-							responseSummary = responseSummary.substring(0, 125) + "...";
+							responseSummary = new NekoHTMLFilter().filter(responseSummary);
+							if(responseSummary.length() > 128) {
+								responseSummary = responseSummary.substring(0, 125) + "...";
+							}
 						}
 						uifactory.addStaticTextElement("item_correct_response_" + count++, null, responseSummary, correctResponsesCont);
 					}
-- 
GitLab