From: Jan Szejko <janek37@gmail.com> Date: Tue, 12 Sep 2017 16:17:42 +0000 (+0200) Subject: transform match exercise to WL1 X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/1dde5a89c598158a3663e1586fc5ac061b9bf542?ds=sidebyside;hp=349703205c1f87da589c9cb447070955d3aaf8bb transform match exercise to WL1 --- diff --git a/redakcja/xslt/wl2to1.xslt b/redakcja/xslt/wl2to1.xslt index e88412ac..6882a753 100644 --- a/redakcja/xslt/wl2to1.xslt +++ b/redakcja/xslt/wl2to1.xslt @@ -56,7 +56,7 @@ </xsl:template> <!-- TODO language-dependent: description, audience, requires (subject.competence?) --> -<xsl:template match="dc:creator.expert|dc:creator.scenario|dc:creator.textbook|dc:description|dc:subject.curriculum|dc:creator.methodologist|dc:subject.competence|dc:audience|dc:type|dc:requires" mode="meta"> +<xsl:template match="dc:creator.expert|dc:creator.scenario|dc:creator.textbook|dc:description|dc:subject.curriculum|dc:subject.curriculum.new|dc:creator.methodologist|dc:subject.competence|dc:audience|dc:type|dc:requires" mode="meta"> <xsl:copy><xsl:apply-templates /></xsl:copy> </xsl:template> @@ -92,7 +92,15 @@ <akap><xsl:apply-templates /></akap> </xsl:when> <xsl:when test="@class = 'list'"> - <lista typ="punkt"><xsl:apply-templates /></lista> + <lista typ="punkt"> + <xsl:if test="@name"> + <xsl:attribute name="nazwa"><xsl:value-of select="@name"/></xsl:attribute> + </xsl:if> + <xsl:if test="@dest"> + <xsl:attribute name="cel"><xsl:value-of select="@dest"/></xsl:attribute> + </xsl:if> + <xsl:apply-templates /> + </lista> </xsl:when> <xsl:when test="@class = 'list.itemized'"> <lista typ="punkt"><xsl:apply-templates /></lista> @@ -119,8 +127,11 @@ <xsl:when test="@class = 'item'"> <punkt><xsl:apply-templates /></punkt> </xsl:when> + <xsl:when test="@class = 'item.category'"> + <punkt nazwa="{@name}"><xsl:apply-templates /></punkt> + </xsl:when> <xsl:when test="@class = 'item.answer'"> - <xsl:element name="punkt"> + <punkt> <xsl:attribute name="rozw"> <xsl:choose> <xsl:when test="@answer = 'true'">prawda</xsl:when> @@ -129,7 +140,7 @@ </xsl:choose> </xsl:attribute> <xsl:apply-templates /> - </xsl:element> + </punkt> </xsl:when> <xsl:when test="@class = 'question'"> <pytanie> @@ -169,6 +180,11 @@ <xsl:call-template name="cwiczenie"/> </cwiczenie> </xsl:when> + <xsl:when test="@class = 'exercise.match'"> + <cwiczenie typ="przyporzadkuj"> + <xsl:call-template name="cwiczenie"/> + </cwiczenie> + </xsl:when> <xsl:when test="@class = 'exercise.gap'"> <cwiczenie typ="luki"> <opis><akap>UzupeÅnij luki:</akap></opis> @@ -269,6 +285,7 @@ <xsl:choose> <xsl:when test="@class = 'p'"> <opis><xsl:apply-templates select="."/></opis> + <!-- https://stackoverflow.com/questions/27374493/grouping-the-consecutive-elements-in-xslt --> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="."/>