Commit 659435bb authored by Neveux Anais's avatar Neveux Anais

add fill-in-the-blank exercice

parent a116e22d
......@@ -25,6 +25,7 @@ Un utilisateur a cr
- 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.
- Add "Exercice redactionnel" and transclusion.
- Fill-in-the blank (and transclusion)
## Known bugs
- You can have an exercice with no question but a solution. We should add a if statement to handle this.
......@@ -35,4 +36,5 @@ Un utilisateur a cr
- Handle multiple files conversion
- Add all other type of exercices
- Handle other kind of paragraph
- Handle resources (images for example)
\ No newline at end of file
- Handle resources (images for example)
- Handle sub-level transclusion
\ No newline at end of file
......@@ -160,6 +160,13 @@
<xsl:value-of select="." />
</span>
</xsl:template>
<xsl:template match="sc:para/sc:textLeaf[@role='gap']" priority = "2">
<span data-hdoc-type="blank">
<xsl:value-of select="."/>
</span>
</xsl:template>
<!-- default behaviour for other balises -->
<xsl:template match="sc:para/sc:inlineStyle|sc:para/sc:textLeaf" priority="1">
<xsl:value-of select="." />
......@@ -332,7 +339,48 @@
<!-- ******** FIN ACTIVITE TETM ********** -->
<!-- ******** EXERCICE AVEC CORRIGE ******** -->
<!-- ******** EXERCICE AVEC ET SANS CORRIGE ******** -->
<!-- Texte à trou -->
<xsl:template match="sp:question/cp:cloze | sp:exercice/cp:cloze">
<section data-hdoc-type='fill-in-the-blank'>
<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/sp:body/cp:flow/sp:txt/cp:txt//sc:para"/>
</div>
<div data-hdoc-type='gapText'>
<xsl:apply-templates select="sc:gapText/cp:txtCloze/sc:para"/>
</div>
<xsl:if test="../name() = 'sp:question'">
<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:item/cp:cloze">
<xsl:param name="withoutExplanation"/>
<section data-hdoc-type='fill-in-the-blank'>
<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/sp:body/cp:flow/sp:txt/cp:txt//sc:para"/>
</div>
<div data-hdoc-type='gapText'>
<xsl:apply-templates select="sc:gapText/cp:txtCloze/sc:para"/>
</div>
<xsl:if test="$withoutExplanation = 'sp:question'">
<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>
<!-- Questionnement -->
......
......@@ -27,6 +27,7 @@ A .scar example is already in the input folder.
- Method and Remind fully functional
- QCM and QCU working, even with transclusion.
- Add "Exercice redactionnel" and transclusion.
- Fill-in-the-blank with transclusion.
## Known bugs
- You can have an exercice with no question but a solution. We should add a if statement to handle this.
......
......@@ -445,7 +445,7 @@
<xsl:choose>
<!-- If it is directly included in a div, we have to add Opale's text markups -->
<xsl:when test="parent::*[name() = 'div']">
<xsl:when test="parent::*[name() = 'div'] and not(parent::*[@data-hdoc-type = 'gapText'])">
<sp:txt>
<op:txt>
<xsl:call-template name="blockloop"/>
......@@ -630,6 +630,39 @@
</sp:listing>
</xsl:template>
<!-- Fill-in-the-blank -->
<xsl:template match="h:section[@data-hdoc-type = 'fill-in-the-blank']" priority="2">
<sp:trainUcCloze>
<op:cloze>
<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 = 'question']"/>
<xsl:apply-templates select="h:div[@data-hdoc-type = 'gapText']"/>
<sc:globalExplanation>
<op:res>
<xsl:apply-templates select="./h:div[@data-hdoc-type = 'explanation']/h:p"/>
</op:res>
</sc:globalExplanation>
</op:cloze>
</sp:trainUcCloze>
</xsl:template>
<xsl:template match="h:div[@data-hdoc-type = 'gapText']">
<sc:gapText>
<op:clozeTxt>
<xsl:apply-templates select="./*"/>
</op:clozeTxt>
</sc:gapText>
</xsl:template>
<xsl:template match="h:span[@data-hdoc-type = 'blank']">
<sc:textLeaf role="gap">
<xsl:apply-templates select="./* | ./text()"/>
</sc:textLeaf>
</xsl:template>
<!-- Open Question -->
<xsl:template match="h:section[@data-hdoc-type = 'exercise']">
<sp:practUc>
......
......@@ -60,6 +60,7 @@
<value>explanation-choice-incorrect</value>
<value>openQuestion</value>
<value>hint</value>
<value>gapText</value>
</choice>
</attribute>
</optional>
......
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