Closed luclaurent closed 3 years ago
Notice that we can decide to remove the text before the question
if it is preferable but we need to add a warning. A minimal behavior is that the question can be imported in Moodle (with or without the text in the element
block).
I will have a look on that. The problem is that the actual mapping between tex \element
and moodle category
is too crude.
The first argument is mapped into category name and it's fine, the second one contains the questions and everything the user want. For instance, some amc users use \element
as common description for all the questions from the block (see https://github.com/nennigb/amc2moodle/issues/20#issuecomment-653435909)
The latexml output for your exemple are
With the line break
<document xmlns="http://dlmf.nist.gov/LaTeXML">
<resource src="LaTeXML.css" type="text/css"/>
<resource src="ltx-article.css" type="text/css"/>
<note class="amc_categorie">test</note>
<para xml:id="p1">
<p>uioygbjkbk, hhHLJmq jkjlkqjs qjlkjqs lk
aa</p>
</para>
<note class="amc_question" role="qtest"><inline-para>
<para xml:id="p2">
<p>Loui
<note class="amc_mauvaise"> hein</note>
<note class="amc_mauvaise">oh</note>
<note class="amc_bonne">ah</note>
<note class="amc_mauvaise">ouf</note></p>
</para>
</inline-para></note>
</document>
without the line break, we get a nested structure since the question belong to the paragraph
<document xmlns="http://dlmf.nist.gov/LaTeXML">
<resource src="LaTeXML.css" type="text/css"/>
<resource src="ltx-article.css" type="text/css"/>
<note class="amc_categorie">test</note>
<para xml:id="p1">
<p>uioygbjkbk, hhHLJmq jkjlkqjs qjlkjqs lk
aa
<note class="amc_question" role="qtest"><inline-para>
<para xml:id="p1.p1">
<p>Loui
<note class="amc_mauvaise"> hein</note>
<note class="amc_mauvaise">oh</note>
<note class="amc_bonne">ah</note>
<note class="amc_mauvaise">ouf</note></p>
</para>
</inline-para></note></p>
</para>
</document>
Some possible workarounds/remarks,
<para>
children ?\elements
in the question bank, to be sure it works.DefConstructor('\element{}{}',"<ltx:note class='amc_categorie'>#1</ltx:note>#2");
Just drop everything out. Not very robust; break the hierarchical link between \element
and its non question children\QuestionIndicative
in magic comment...
\element{test}{
%amc2moodle \begin{question}{fragment} \QuestionIndicative
uioygbjkbk, hhHLJmq jkjlkqjs qjlkjqs lk
aa
%amc2moodle \end{question}
\begin{question}{qtest}
Loui
\begin{reponses}
\mauvaise{ hein}
\mauvaise{oh}
\bonne{ah}
\mauvaise{ouf}
\end{reponses}
\end{question}
}
moodleExclude
environment, that can be use between magic comments
Many authors of AMC quizz add text outside questions and
automultiplechoice
will render it correctly but `amc2moodle' seems to have difficulties to consider it (which can be normal). However in certains cases question(s) could not be imported in Moodle.The following example does not work.
One solution seems to add a linebreak before the `\begin{question}' command:
The XML formatter is able to isolate the text before the
\begin{question}
in a paragraph<p>...</p>
and this syntax seems to be accepted by Moodle.amc2moodle
v2.9.0 was used to diagnose this trouble.