simplify question conversion
authorJan Szejko <janek37@gmail.com>
Tue, 22 Aug 2017 14:46:49 +0000 (16:46 +0200)
committerJan Szejko <janek37@gmail.com>
Tue, 22 Aug 2017 14:46:49 +0000 (16:46 +0200)
redakcja/xslt/wl2to1.xslt

index 75eb00d..e88412a 100644 (file)
                 <xsl:apply-templates />
             </xsl:element>
         </xsl:when>
+        <xsl:when test="@class = 'question'">
+            <pytanie>
+                <xsl:for-each select="div">
+                    <xsl:choose>
+                        <xsl:when test="@class = 'p'">
+                            <xsl:apply-templates />
+                        </xsl:when>
+                        <xsl:otherwise>
+                            <xsl:apply-templates select="."/>
+                        </xsl:otherwise>
+                    </xsl:choose>
+                </xsl:for-each>
+            </pytanie>
+        </xsl:when>
         <xsl:when test="@class = 'defined'">
             <xsl:choose>
                 <xsl:when test="count(ancestor::*) = 4 ">
         </xsl:when>
         <xsl:when test="@class = 'exercise.choice' or @class = 'exercise.choice.single'">
             <cwiczenie typ="wybor">
-                <opis><akap>[opis]</akap></opis>
-                <lista typ="num">
-                    <punkt>
-                        <pytanie>
-                            <xsl:for-each select="div">
-                                <xsl:choose>
-                                    <xsl:when test="@class = 'p'">
-                                        <xsl:apply-templates />
-                                    </xsl:when>
-                                    <xsl:otherwise>
-                                        <xsl:apply-templates select="."/>
-                                    </xsl:otherwise>
-                                </xsl:choose>
-                            </xsl:for-each>
-                        </pytanie>
-                    </punkt>
-                </lista>
+                <xsl:call-template name="cwiczenie"/>
             </cwiczenie>
         </xsl:when>
         <xsl:when test="@class = 'exercise.gap'">