Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
hdoc
Commits
d77c17a9
Commit
d77c17a9
authored
Jan 01, 2017
by
qkeunebr
Browse files
Implemented the transformation mindmapping2opale for QCU, updated the hdoc2opale schema
parent
8802ec1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
hdoc_to_opale/xsl/transformation2.xsl
View file @
d77c17a9
...
...
@@ -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']"
/>
...
...
mindmapping_to_hdoc/xslt/sect.xsl
View file @
d77c17a9
...
...
@@ -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"
/>
...
...
schemas/xhtml/type.rng
View file @
d77c17a9
...
...
@@ -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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment