From 1132dc78df65967eadcc013b33564e270e1b97e7 Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Wed, 31 Jul 2013 14:45:36 +0200
Subject: [PATCH] OO-681: enhance the XSL stylesheet which outputs the results
 to handle interval of values as correct answer

---
 .../resources/xsl/results2html_generic.xsl    | 27 ++++++++++++++-----
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/olat/ims/resources/xsl/results2html_generic.xsl b/src/main/java/org/olat/ims/resources/xsl/results2html_generic.xsl
index d06e3710d7f..c6e58f753ab 100644
--- a/src/main/java/org/olat/ims/resources/xsl/results2html_generic.xsl
+++ b/src/main/java/org/olat/ims/resources/xsl/results2html_generic.xsl
@@ -488,19 +488,34 @@ border-collapse: collapse;
 		<!-- skip itemfeedback -->
 	</xsl:template>
 
+	<xsl:template match="extension_item_result_bak">
+		<xsl:param name="item_id"/>
+		<xsl:apply-templates select="conditionvar/and/or"><xsl:with-param name="item_id" select="$item_id"/></xsl:apply-templates>
+	</xsl:template>
+	
 	<xsl:template match="extension_item_result">
-	<xsl:param name="item_id"/>		
-		<xsl:apply-templates select="conditionvar/and/or"><xsl:with-param name="item_id" select="$item_id"/></xsl:apply-templates>			
+		<xsl:param name="item_id"/>
+		<xsl:choose>
+			<xsl:when test="conditionvar/and/or">
+				<xsl:apply-templates select="conditionvar/and/or"><xsl:with-param name="item_id" select="$item_id"/></xsl:apply-templates>
+			</xsl:when>
+			<xsl:when test="conditionvar/and">
+				<xsl:apply-templates select="conditionvar/and"><xsl:with-param name="item_id" select="$item_id"/></xsl:apply-templates>
+			</xsl:when>
+			<xsl:otherwise>
+				<xsl:apply-templates />
+			</xsl:otherwise>
+		</xsl:choose>
 	</xsl:template>
 	
 	<xsl:template match="conditionvar">
 		<xsl:apply-templates/>
 	</xsl:template>
 
-	<xsl:template match="vargte">GROESSER&nbsp;GLEICH&nbsp;<xsl:value-of select="."/>&nbsp;<xsl:apply-templates/></xsl:template>
-	<xsl:template match="varlte">KLEINER&nbsp;GLEICH&nbsp;<xsl:value-of select="."/>&nbsp;<xsl:apply-templates/></xsl:template>
-	<xsl:template match="varlt">KLEINER&nbsp;<xsl:value-of select="."/>&nbsp;<xsl:apply-templates/></xsl:template>
-	<xsl:template match="vargt">GROESSER&nbsp;<xsl:value-of select="."/>&nbsp;<xsl:apply-templates/></xsl:template>
+	<xsl:template match="vargte">&gt;=&nbsp;<xsl:value-of select="."/>&nbsp;<xsl:apply-templates/></xsl:template>
+	<xsl:template match="varlte">&lt;=&nbsp;<xsl:value-of select="."/>&nbsp;<xsl:apply-templates/></xsl:template>
+	<xsl:template match="varlt">&lt;&nbsp;<xsl:value-of select="."/>&nbsp;<xsl:apply-templates/></xsl:template>
+	<xsl:template match="vargt">&gt;&nbsp;<xsl:value-of select="."/>&nbsp;<xsl:apply-templates/></xsl:template>
 	<xsl:template match="vareq">&nbsp;<xsl:apply-templates/></xsl:template>
 	<!-- 
 	<xsl:template match="varequal">&nbsp;<xsl:value-of select="." disable-output-escaping="yes"/><xsl:apply-templates/></xsl:template>
-- 
GitLab