Commit e2174339 authored by Neveux Anais's avatar Neveux Anais

add QCM and QCU, with transclusion

parent 0859d502
......@@ -12,5 +12,7 @@ Un utilisateur a cr
## What the converter handle
- Sequence
- Session
- Activity created in the .programme, transclusion should be available soon.
- Information/Warning/Advice/ect... Method and Remind aren't handled yet.
\ No newline at end of file
- Activity created in the .programme, transclusion available.
- Information/Warning/Advice/ect...
- Method and Remind fully functional.
- Add QCU and QCM. Transclusion of them available too. Need to fix a schema validation error when putting a title to a question, without filling the question content.
\ No newline at end of file
......@@ -10,7 +10,6 @@
<antcall target="hdoc_structure"/>
<antcall target="process_canoscar"/>
<antcall target="not_canoscar"/>
<echo message="OK" file="${out}/testfile"/>
<antcall target="zip" />
<antcall target="clean"/>
......@@ -46,6 +45,7 @@
<!-- delete folders -->
<delete dir="${unzipfolder}"/>
<delete dir="${tmp}"/>
<delete dir="${hdoc}"/>
<delete file="get_ressources.ant"/>
</target>
......
......@@ -27,6 +27,8 @@
<body>
<xsl:apply-templates select="cp:programM/sp:abstract"/>
<xsl:apply-templates select="child::*[name() != 'cp:programM']"/>
<!-- TODO : apply-templates des exercices -->
<xsl:apply-templates select="descendant::*[sp:question]/sp:question | descendant::*[sp:exercice]/sp:exercice"/>
</body>
</html>
</xsl:template>
......@@ -225,7 +227,7 @@
<h1><xsl:value-of select="cp:activityM/sp:title"/></h1>
</header>
<xsl:apply-templates select="sp:body/cp:blocks/* | sp:section/cp:textActivity"/>
<xsl:apply-templates select="sp:body/cp:blocks/*[name() != 'sp:question' and name() != 'sp:exercice'] | sp:section/cp:textActivity"/>
</section>
</xsl:template>
......@@ -315,4 +317,105 @@
<!-- ******** FIN ACTIVITE TETM ********** -->
<!-- ******** EXERCICE AVEC CORRIGE ******** -->
<!-- Questionnement -->
<!-- TODO gerer multiple texte, remarque prof, ect... -->
<xsl:template match="sp:question/cp:openQuestion">
<section data-hdoc-type='exercise'>
<header>
<h1><xsl:value-of select="cp:questionM/sp:title"/></h1>
</header>
<!-- TODO work with description -->
<xsl:if test="sp:question/cp:flow/*">
<div data-hdoc-type='question'>
<xsl:apply-templates select="sp:question/cp:flow/sp:txt/cp:txt/sc:para"/>
</div>
</xsl:if>
<xsl:if test="sp:solution">
<div data-hdoc-type='solution'>
<xsl:apply-templates select="sp:solution/cp:flow/sp:txt/cp:txt/sc:para"/>
</div>
</xsl:if>
</section>
</xsl:template>
<!-- QCM and QCU-->
<xsl:template match="sp:question/cp:qcm | sp:exercice/cp:qcm | sc:item/cp:qcm">
<section>
<header>
<h1><xsl:value-of select="cp:questionM/sp:title"/></h1>
</header>
<div data-hdoc-type = 'question'>
<xsl:apply-templates select='sc:question/cp:block'/>
</div>
<xsl:apply-templates select="sc:choices/sc:choice"/>
<xsl:if test="sc:globalExplanation/cp:block/sp:body/cp:flow/sp:txt">
<div data-hdoc-type='explanation'>
<xsl:apply-templates select="sc:globalExplanation/cp:block/sp:body/cp:flow/sp:txt/cp:txt//sc:para"/>
</div>
</xsl:if>
</section>
</xsl:template>
<xsl:template match="sp:question/cp:qcu | sp:exercice/cp:qcu | sc:item/cp:qcu">
<section>
<header>
<h1><xsl:value-of select="cp:questionM/sp:title"/></h1>
</header>
<div data-hdoc-type='singlechoicequestion'>
<xsl:apply-templates select="sc:question/cp:block"/>
</div>
<xsl:apply-templates select="sc:choices//sc:choice"/>
<div data-hdoc-type='solution'><p><xsl:value-of select="sc:solution/@choice"/></p></div>
<xsl:if test="sc:globalExplanation/cp:block/sp:body/cp:flow/sp:txt">
<div data-hdoc-type='explanation'>
<xsl:apply-templates select="sc:globalExplanation/cp:block/sp:body/cp:flow/sp:txt/cp:txt//sc:para"/>
</div>
</xsl:if>
</section>
</xsl:template>
<xsl:template match="sc:choice">
<div data-hdoc-type='choice'>
<xsl:apply-templates select="sc:choiceLabel/cp:txt/sc:para"/>
</div>
<xsl:if test="sc:choiceExplanation">
<div data-hdoc-type='explanation-choice-correct'>
<xsl:apply-templates select="sc:choiceExplanation/cp:txt/sc:para"/>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="sc:choice[@solution]">
<xsl:choose>
<xsl:when test="@solution = 'checked'">
<div data-hdoc-type='choice-correct'>
<xsl:apply-templates select="sc:choiceLabel/cp:txt/sc:para"/>
</div>
</xsl:when>
<xsl:otherwise>
<div data-hdoc-type='choice-incorrect'>
<xsl:apply-templates select="sc:choiceLabel/cp:txt/sc:para"/>
</div>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="sc:choiceExplanation">
<div data-hdoc-type='explanation-choice-correct'>
<xsl:apply-templates select="sc:choiceExplanation/cp:txt/sc:para"/>
</div>
</xsl:if>
</xsl:template>
<xsl:template match="sp:question[@sc:refUri] | sp:exercice[@sc:refUri]">
<xsl:apply-templates select="document(@sc:refUri)"/>
</xsl:template>
<xsl:template match="sp:question | sp:exercice">
<xsl:apply-templates select="./*"/>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
......@@ -47,6 +47,7 @@
>
<param name="filename" expression="${{tmp}}/${{filename}}"/>
</xslt>
<chmod file="${{tmp}}/${{filename}}/decompressedOpale/main.xml" perm="777"/>
<!-- Finding references and converting them -->
......
......@@ -736,7 +736,7 @@
<xsl:value-of select="./h:p"></xsl:value-of>
</xsl:attribute>
</sc:solution>
</xsl:template>
</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. -->
......
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