Commit d77c17a9 authored by qkeunebr's avatar qkeunebr

Implemented the transformation mindmapping2opale for QCU, updated the hdoc2opale schema

parent 8802ec1b
......@@ -602,9 +602,8 @@
</sp:listing>
</xsl:template>
<!-- MCQ-->
<xsl:template match="h:section[h:div[@data-hdoc-type = 'question']]">
<!-- Selecting the first question -->
<sp:trainUcMcqMur>
<op:mcqMur>
<op:exeM>
......@@ -612,14 +611,10 @@
<xsl:value-of select="./h:header/h:h1"/>
</sp:title>
</op:exeM>
<xsl:apply-templates select="./h:div[@data-hdoc-type = 'question']" />
<sc:choices>
<xsl:apply-templates select="./h:div[@data-hdoc-type = 'choice-correct' or @data-hdoc-type = 'choice-incorrect']"/>
</sc:choices>
<sc:globalExplanation>
<op:res>
<xsl:apply-templates select="./h:div[@data-hdoc-type = 'explanation']/h:p"/>
......@@ -628,8 +623,33 @@
</op:mcqMur>
</sp:trainUcMcqMur>
</xsl:template>
<!-- Single choice question-->
<xsl:template match="h:section[h:div[@data-hdoc-type = 'singlechoicequestion']]">
<!-- Selecting the first question -->
<sp:trainUcMcqSur>
<op:mcqSur>
<op:exeM>
<sp:title>
<xsl:value-of select="./h:header/h:h1"/>
</sp:title>
</op:exeM>
<xsl:apply-templates select="./h:div[@data-hdoc-type = 'singlechoicequestion']" />
<sc:choices>
<xsl:apply-templates select="./h:div[@data-hdoc-type = 'choice']"></xsl:apply-templates>
</sc:choices>
<xsl:apply-templates select="./h:div[@data-hdoc-type = 'solution']" />
<sc:globalExplanation>
<op:res>
<xsl:apply-templates select="./h:div[@data-hdoc-type = 'explanation']/h:p"/>
</op:res>
</sc:globalExplanation>
</op:mcqSur>
</sp:trainUcMcqSur>
</xsl:template>
<xsl:template match="h:div[@data-hdoc-type = 'question']">
<!-- Question within MCQ and single choice question-->
<xsl:template match="h:div[@data-hdoc-type = 'question' or @data-hdoc-type = 'singlechoicequestion']">
<sc:question>
<op:res>
<xsl:apply-templates select="./*" />
......@@ -637,6 +657,7 @@
</sc:question>
</xsl:template>
<!-- Question within MCQ and single choice question-->
<xsl:template match="h:div[@data-hdoc-type = 'choice-correct']">
<sc:choice solution="checked">
<xsl:call-template name="choice" />
......@@ -662,7 +683,14 @@
</sc:choiceExplanation>
</sc:choice>
</xsl:template>
<xsl:template match="./h:div[@data-hdoc-type = 'choice']">
<sc:choice>
<xsl:call-template name="choice" />
</sc:choice>
</xsl:template>
<xsl:template name="choice">
<sc:choiceLabel>
<op:txt>
......@@ -674,6 +702,14 @@
</sc:choiceLabel>
</xsl:template>
<xsl:template match="h:div[@data-hdoc-type = 'solution']">
<sc:solution>
<xsl:attribute name="choice">
<xsl:value-of select="./h:p"></xsl:value-of>
</xsl:attribute>
</sc:solution>
</xsl:template>
<!-- These markups are matched in order to minimize "apply-templates select="./*" side-effects (i.e. their content are already treated into another template or they are not (yet) supported). -->
<!-- Unsupported. -->
<xsl:template match="h:div[@data-hdoc-types = 'categories']"/>
......
......@@ -239,7 +239,7 @@
</xsl:element>
</xsl:template>
<!-- QCMs -->
<!-- MCQ -->
<xsl:template match="node[contains(@TEXT, '#question')]" priority="2">
<xsl:element name="section">
<xsl:element name="header">
......@@ -259,6 +259,28 @@
</xsl:element>
</xsl:template>
<!-- QCU -->
<xsl:template match="node[contains(@TEXT, '#singlechoicequestion')]" priority="2">
<xsl:element name="section">
<xsl:element name="header">
<xsl:element name="h1">QCU</xsl:element>
</xsl:element>
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">singlechoicequestion</xsl:attribute>
<xsl:element name="ul">
<xsl:element name="li">
<xsl:element name="p">
<xsl:value-of select="utc:remove-language(@TEXT)"/>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<!-- Match the global explanation of of a question within a QCM -->
<xsl:template match="node[contains(@TEXT, '#explanation')]" priority="2">
<xsl:element name="div">
......@@ -311,6 +333,29 @@
</xsl:element>
</xsl:template>
<!-- Match the answers of a question within a QCU -->
<xsl:template match="node[contains(@TEXT, '#choice-qcu')]" priority="2">
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">choice</xsl:attribute>
<xsl:element name="p">
<xsl:value-of select="utc:remove-language(@TEXT)"/>
</xsl:element>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<!-- Match the solution of a QCU -->
<xsl:template match="node[contains(@TEXT, '#solution')]" priority="2">
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">solution</xsl:attribute>
<xsl:element name="p">
<xsl:value-of select="utc:remove-language(@TEXT)"/>
</xsl:element>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<!-- Default behavior for intro and conclu nodes : do nothing -->
<xsl:template match="node[contains(@TEXT, '#intro')] | node[contains(@TEXT, '#conclu')]"
priority="3"/>
......
......@@ -48,6 +48,9 @@
<value>advice</value>
<!-- quiz management -->
<value>question</value>
<value>singlechoicequestion</value>
<value>choice</value>
<value>solution</value>
<value>choice-correct</value>
<value>choice-incorrect</value>
<value>explanation</value>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment