nennigb / amc2moodle Goto Github PK
View Code? Open in Web Editor NEWamc2moodle, is an automatic tool to convert multiple choice quiz between auto-muliple-choice LaTeX format and moodle XML format.
License: GNU General Public License v3.0
amc2moodle, is an automatic tool to convert multiple choice quiz between auto-muliple-choice LaTeX format and moodle XML format.
License: GNU General Public License v3.0
Tests should be run periodically (each month) to detect earlier dependencies evolution.
Hi,
Feel free to ask your questions here :
In case of trouble during the conversion, put the command line output to help to locate the origin of the problem.
nennigb
I have several problems written using AMC that I'd like to convert to Moodle. (And in the future, I'd like to continue writing my problems using AMC before converting them to Moodle, because its much easier than using Moodle's web interface.)
These problems consist in several paragraphs of introduction (and often some pseudo-code and tikz figures), followed by several AMC questions. All of this is written in one \element{}{...}
block.
Here is an example:
\element{analyse}{
Some descriptive text presenting the next two functions.
\begin{multicols}{2}
\inputminted{c}{exam-201901-fun1.c}
\columnbreak
\inputminted{c}{exam-201901-fun2.c}
\end{multicols}
\begin{multicols}{2}
\begin{question}{anal1}\bareme{b=1,m=0}
Question1 text.
\begin{choices}
\wrongchoice{...}
\wrongchoice{...}
\wrongchoice{...}
\correctchoice{...}
\end{choices}
\end{question}
\begin{question}{anal2}\bareme{b=2,m=0}
Question 2 text?
\begin{multicols}{3}
\begin{choices}[o]
\wrongchoice{...}
\wrongchoice{...}
\correctchoice{...}
\wrongchoice{...}
\wrongchoice{...}
\wrongchoice{...}
\end{choices}
\end{multicols}
\end{question}
More description.
\begin{question}{anal3}\bareme{b=1,m=0}
Question3 text.
\begin{choices}
\wrongchoice{...}
\correctchoice{...}
\end{choices}
\end{question}
\end{multicols}
}
Currently amc2moodle
will only convert the questions, but those questions alone are meaningless without the introductory text. Note that we can also have some text between questions, as between question 2 and 3 above (although I could live without).
One plan would be to extract the text that is part of \element{}
but not part of any question to create type="description"
questions. The \element{}
macro gives the category of the question but we need to name the descriptions somehow. And to ease the creation of the moodle quiz, it would best if the various moodle questions (so this includes the descriptions) have name that are alphabetically ordered.
What would you think about the following plan: if amc2moodle
detects that \element
contains description text, then all questions names would be prefixed by some number representing the index of this question. In addition to help the author ordering the question on moodle, the number prefix would make each question name unique, allowing all descriptive questions to be named simply description
. For the above example, the names would be:
1.description
2.anal1
3.anal2
4.description
5.anal3
For extracting the description questions, I'm thinking that maybe one option is to open some tag in \element{}
, then close it upon entering \begin{question}
and reopen it when exiting the question. Then we need some way to remove those tags if they are empty.
What do you think?
PS: the above example also raises another issue, which isn't very important to me at this point: removing multicols
seems OK when it's used to arrange questions or answers, but it could also be legitimately used in the text of a question.
Hi,
how to suppress the CompleMulti option that seems to be set to true by default ?
I tried the AMC macro \AMCnoCompleteMulti but it is not recognized : 1 undefined macro[\AMCnoCompleteMulti].
Fred
I observed that
\baremeDefautS{e=-0.5,b=1,m=-0.5}
works fine, but if white spaces are present after the comma like in
\baremeDefautS{e=-0.5, b=1,m=-0.5}
it fails since the scoring parser (in convert.py
) do not trim white space in the body of the string.
Hi Benoit,
is there a way to choose the percentage of a score that applies to an answer?
For example in a true/false question, choosing 100% for a good response and -100% for the bad response.
Fred
Hi,
Feel free to ask your questions here :
on the usage
on bugs
...
In case of trouble during the conversion, put the command line output to help to locate the origin of the problem.
nennigb
The accented character, for instance in the path name, are not fully supported in lxml.etree with python 2.
Hello. I have this problem:
ValueError: dictionary update sequence element #2 has length 1; 2 is required
[INFO ]: ========================
[INFO ]: ========================
[INFO ]: === Start amc2moodle ===
[INFO ]: ========================
[INFO ]: ========================
[INFO ]: ====== Build XML =======
[INFO ]: > Search for magic comments...
[INFO ]: > Running LaTeXML pre-processing (may take a while)...
[INFO ]: > Running LaTeXML conversion
[INFO ]: > Running Python conversion...
Traceback (most recent call last):
File "/home/alain/Applications/amc2moodle/./bin/amc2moodle", line 163, in <module>
run()
File "/home/alain/Applications/amc2moodle/./bin/amc2moodle", line 148, in run
a2m.amc2moodle(fileInput=fileIn, fileOutput=fileOut,keepFlag=keepFlag, catname=catname,indentXML=indentFlag, usetempdir=tempDir,magic_flag=magic_flag, cleanXML=cleanXML,include_styles=include_styles)
File "/home/alain/Applications/amc2moodle/lib/python3.11/site-packages/amc2moodle/amc2moodle/amc2moodle_class.py", line 171, in __init__
self.runBuilding()
File "/home/alain/Applications/amc2moodle/lib/python3.11/site-packages/amc2moodle/amc2moodle/amc2moodle_class.py", line 329, in runBuilding
convert.to_moodle(
File "/home/alain/Applications/amc2moodle/lib/python3.11/site-packages/amc2moodle/amc2moodle/convert.py", line 1116, in to_moodle
quiz.toMoodle(os.path.join(pathout, fileout))
File "/home/alain/Applications/amc2moodle/lib/python3.11/site-packages/amc2moodle/amc2moodle/convert.py", line 852, in toMoodle
self._scoring()
File "/home/alain/Applications/amc2moodle/lib/python3.11/site-packages/amc2moodle/amc2moodle/convert.py", line 981, in _scoring
amc_bm = scoring2dict(barm[0].text)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/alain/Applications/amc2moodle/lib/python3.11/site-packages/amc2moodle/amc2moodle/convert.py", line 109, in scoring2dict
scoring = dict(map(str.strip, item.split("=")) for item in text.split(","))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: dictionary update sequence element #2 has length 1; 2 is required
Hi,
thanks for this very nice code. I am trying to use it with my test but I have a lot of chemical formulae written using the package mhchem which is quite used for chemical notations. Is it possible to add some biding for this package? The syntax is quite simple, it introduces a new latex environment "\ce{}" in which the chemical formulae or equation is typed. For example
\ce{H^+} gives a result simular to
At the moment amc2moodle complains that the symbol ^ can be used only in math mode so I get an XML file full of errors.
Is it possible to solve or at least bypass the problem?
Thanks,
Raffaele
Hi!
I recently had to reconvert a question I had successfully translated with an older version of amc2moodle, but the new version failed to render online. My question had a large equation containing symbols < and >. The produced XML output was incorrectly producing those symbols verbatim, instead of escaping them with < and >. This in turn caused the online rendering of the question to be completely broken, because the browser would see opening tags in my equation when there was none, and then it would attempt to close those to fix things up.
I know that version 2.5.0 correctly escapes < and >, as this is the version I ended up using.
Version 2.6.0 is broken in that regards.
In patch e02307b, you can see the regression appearing in this snippet:
--- a/amc2moodle/amc2moodle/test/QCM.xml
+++ b/amc2moodle/amc2moodle/test/QCM.xml
@@ -91,7 +92,7 @@
]]></text></questiontext><answer format="html" fraction="33.333333333333336"><text><![CDATA[ Ou en <tt>C</tt> using <tt>alltt</tt> package
<p><pre>
-int s=-2; <br/>for (int i=0;i<4; i++)<text font="serif">{</text> <br/>s=i*i+s; <br/><text font="serif">}</text>
+int s=-2; <br/>for (int i=0;i<4; i++)<text font="serif">{</text> <br/>s=i*i+s; <br/><text font="serif">}</text>
</pre></p>
]]></text></answer><answer format="html" fraction="33.333333333333336"><text><![CDATA[
\(\lvert-10-2\rvert\)
Hi
is there any way to change the tag value ? By default, it seems to be set to "abc". I would like to set it to none or "123".
Fred
In these COVID times your repository attracted me.
I am running the three examples provided (QCM, QCM_wo-tikz and numerical).
For the latter it works fine.
For the two first ones I a experiencing the following issue
Running Python conversion...
Traceback (most recent call last):
File "/Users/vkeryvin/opt/anaconda3/bin/amc2moodle", line 117, in
run()
File "/Users/vkeryvin/opt/anaconda3/bin/amc2moodle", line 108, in run
magic_flag=magic_flag)
File "/Users/vkeryvin/opt/anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/amc2moodle_class.py", line 149, in init
self.runBuilding()
File "/Users/vkeryvin/opt/anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/amc2moodle_class.py", line 271, in runBuilding
deb=self.deb)
File "/Users/vkeryvin/opt/anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/convert.py", line 1006, in to_moodle
quiz.toMoodle(os.path.join(pathout, fileout))
File "/Users/vkeryvin/opt/anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/convert.py", line 781, in toMoodle
self._graphics()
File "/Users/vkeryvin/opt/anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/convert.py", line 890, in _graphics
img_name = Ii.attrib['candidates'].split(',')[-1] #get the last candidates
File "src/lxml/etree.pyx", line 2479, in lxml.etree._Attrib.getitem
KeyError: 'candidates'
I'm using OSX 10.15.5
Thank you for your repo and hope you can help me.
When I use AMC, each possible choice has a box to tick, and these choices are not numbered.
Testing amc2moodle
on a small example, I see that each possible answer gets numbered (a, b, c, ...).
This can be quite confusing. Consider:
What is the first letter of the alphabet?
Select one:
◯ a. b
◯ b. z
◯ c. a
Clearly I'd prefer to see
What is the first letter of the alphabet?
Select one:
◯ b
◯ z
◯ a
How do you feel about forcing <answernumbering>none</answernumbering>
for all questions?
Considering the following latex script:
\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{array}
\usepackage[francais,bloc,correc]{automultiplechoice}
\usepackage{multicol}
\usepackage{subfig}
\usepackage{graphics}
\newcommand{\vect}[1]{\overrightarrow{#1}}
\graphicspath{{figures/}}
\begin{document}
\element{cinematique}{
\begin{question}{graphestructure}
So
\begin{center}
\includegraphics[width=0.5\textwidth]{graphe_structure.pdf}
\end{center}
\begin{reponses}
\bonne{aa}
\end{reponses}
\end{question}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\exemplaire{1}{
\restituegroupe{cinematique}
\AMCcleardoublepage
}
\end{document}
graphe_structure.pdf
is not on the root folder but in figures
.
amc2moodle is not working. See below:
(Digesting TeX debug...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/TeX.pool.ltxml...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/eTeX.pool.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/pdfTeX.pool.ltxml... 0.00 sec) 0.11 sec)
(Processing content ZZZZ/amc2moodle/debug.tex...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/LaTeX.pool.ltxml... 0.14 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/article.cls.ltxml... 0.01 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/inputenc.sty.ltxml...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/utf8x.def.ltxml... 0.00 sec) 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/fontenc.sty.ltxml...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/t1enc.def.ltxml...
Warning:missing_file:t1enc Can't find definitions t1enc
at t1enc.def.ltxml; line 24
Anticipate undefined macros or environments
search paths are ZZZZ/amc2moodle, ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle
In Core::Gullet[@0x7f910d25dc78] /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/t1enc.def.ltxml; line 24
0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/t1.fontmap.ltxml... 0.00 sec) 0.01 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/amsmath.sty.ltxml...
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/amsbsy.sty.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/amstext.sty.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/amsopn.sty.ltxml... 0.00 sec) 0.02 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/array.sty.ltxml... 0.00 sec)
(Loading ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/automultiplechoice.sty.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/multicol.sty.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/subfig.sty.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/Package/graphics.sty.ltxml... 0.01 sec)
Warning:expected: Missing number, treated as zero.
at debug.tex; line 25 col 0 - line 25 col 17
while processing \textwidth
In Core::Gullet[@0x7f910d25dc78] ZZZZ/amc2moodle/debug.tex; from line 25 col 0 to line 25 col 17
0.23 sec) 0.34 sec)
(Building...
(Loading compiled schema /usr/local/Cellar/latexml/HEAD-456c715/libexec/lib/perl5/LaTeXML/resources/RelaxNG/LaTeXML.model... 0.01 sec). 0.04 sec)
(Rewriting... 0.00 sec)
(Finalizing... 0.00 sec)
Conversion complete: 2 warnings; 1 missing file[t1enc.def].
processing finished Tue Jun 30 22:08:31 2020
Running Python conversion...
Traceback (most recent call last):
File "ZZZZ/Anaconda3/bin/amc2moodle", line 111, in
run()
File "ZZZZ/Anaconda3/bin/amc2moodle", line 102, in run
indentXML=indentFlag, usetempdir=tempDir)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/amc2moodle_class.py", line 142, in init
self.runBuilding()
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/amc2moodle_class.py", line 227, in runBuilding
deb=self.deb)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/convert.py", line 331, in to_moodle
Ii = encodeImg(Ii, pathin, wdir)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/convert.py", line 93, in encodeImg
img_path)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/convert.py", line 49, in init
self.convertImage(fileIn, fileOut)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/amc2moodle/amc2moodle/convert.py", line 55, in convertImage
im = wandImage(filename=fileIn)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/wand/image.py", line 8294, in init
units=units)
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/wand/image.py", line 8774, in read
self.raise_exception()
File "ZZZZ/Anaconda3/lib/python3.7/site-packages/wand/resource.py", line 243, in raise_exception
raise e
wand.exceptions.BlobError: unable to open image 'graphe_structure.pdf': No such file or directory @ error/blob.c/OpenBlob/3496
</details>
[Archive.zip](https://github.com/nennigb/amc2moodle/files/4854166/Archive.zip)
Do you plan to allow for parameterized questions with fpeval?
Bennoit Nennig proposed some possible approaches in this thread:
https://project.auto-multiple-choice.net/boards/2/topics/4224
Hello,
Your tool is very useful and time saving. Still, when importing the xml file to moodle, the box for automatic shuffle of the answers is not checked.
Please consider adding the following code to the xml file : <shuffleanswers>true</shuffleanswers>
Thanks
In the case of the use of \AMCnumericChoices
in the LaTeX, the conversion from XML to LaTeX could require to add some details in the LaTeX file to precise what kind of answer is expected.
Adapt the existing code to work on Microsoft Windows
Considering the following file:
\documentclass{article}
% \usepackage[combine]{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{array}
\usepackage[francais,bloc,correc]{automultiplechoice}
\usepackage{multicol}
\usepackage{subfig}
\usepackage{graphics}
\newcommand{\vect}[1]{\overrightarrow{#1}}
\graphicspath{{figures/}}
\begin{document}
\element{dynaS3}{
\begin{question}{accS3S0tttt}%\bareme{\barQmult}
\`A partir des résultats précédents, donner l'expression dans la base $(\vect{x_1},\vect{y_1},\vect{z_0})$ de l'accélération du point $G_3$ lié à $S_3$ dans son mouvement par rapport à $R_0$:
\[\vect{\Gamma_{({G_3},S_3/R_0})}\]
\begin{reponses}
\mauvaise{$(\ddot{\lambda}-\lambda\dot{\theta}_{1}^{2})\vect{x_{1}}+(\lambda\ddot{\theta}_{1}+2\dot{\lambda}\dot{\theta}_{1})\vect{y_{1}}$}
\mauvaise{$\ddot{\lambda}\vect{x_{1}}+\lambda\ddot{\theta}_{1}\vect{y_{1}}$}
\bonne{$\ddot{\lambda}\vect{x_{1}}$}
\mauvaise{$\ddot{\lambda}\vect{x_{1}}+(\lambda\ddot{\theta}_{1}+\dot{\lambda}\dot{\theta}_{1})\vect{y_{1}}$}
\end{reponses}
\end{question}
}
\exemplaire{1}{
\restituegroupe{dynaS3}
\AMCcleardoublepage
}
\end{document}
After processing with amc2moodle
, the following xml file is built:
<?latexml class="article"?>
<?latexml package="inputenc" options="utf8x"?>
<?latexml package="fontenc" options="T1"?>
<?latexml package="amsmath"?>
<?latexml package="array"?>
<?latexml package="automultiplechoice" options="francais,bloc,correc"?>
<?latexml package="multicol"?>
<?latexml package="subfig"?>
<?latexml package="graphics"?>
<?latexml graphicspath="/Users/luclaurent/Documents/1PRO/Enseignement/CNAM/HTT_MEC121/ExamensPartiels/2019_Examen2/figures"?>
<?latexml RelaxNGSchema="LaTeXML"?>
<quiz>
<question type="category"><category><text>$course$/amc/dynaS3</text></category></question>
<question type="multichoice"><single>true</single><name><text>accS3S0tttt</text></name><questiontext format="html"><text><![CDATA[
<p>À partir des résultats précédents, donner l’expression dans la base
\((\overrightarrow{x_{1}},\overrightarrow{y_{1}},\overrightarrow{z_{0}})\)
de l’accélération du point
\(G_{3}\)
lié à
\(S_{3}\)
dans son mouvement par rapport à
\(R_{0}\)
:</p>
$$\begin{equation}
\overrightarrow{\Gamma_{({G_{3}},S_{3}/R_{0}})}
\end{equation}$$
]]></text></questiontext><answer format="html" fraction="-50.0"><text><![CDATA[
\((\ddot{\lambda}-\lambda\dot{\theta}_{1}^{2})\overrightarrow{x_{1}}+(\lambda%
\ddot{\theta}_{1}+2\dot{\lambda}\dot{\theta}_{1})\overrightarrow{y_{1}}\)
]]></text><fraction>-50.0</fraction></answer><answer format="html" fraction="-50.0"><text><![CDATA[
\(\ddot{\lambda}\overrightarrow{x_{1}}+\lambda\ddot{\theta}_{1}\overrightarrow{y%
_{1}}\)
]]></text><fraction>-50.0</fraction></answer><answer format="html" fraction="100.0"><text><![CDATA[
\(\ddot{\lambda}\overrightarrow{x_{1}}\)
]]></text><fraction>100.0</fraction></answer><answer format="html" fraction="-50.0"><text><![CDATA[
\(\ddot{\lambda}\overrightarrow{x_{1}}+(\lambda\ddot{\theta}_{1}+\dot{\lambda}%
\dot{\theta}_{1})\overrightarrow{y_{1}}\)
]]></text><fraction>-50.0</fraction></answer><defaultgrade>1.0</defaultgrade><shuffleanswers>true</shuffleanswers><answernumbering>abc</answernumbering></question>
<question type="multichoice"><single>true</single><name><text>momentdynamiqueS3S0G3tttt</text></name><questiontext format="html"><text><![CDATA[
<p>Exprimer dans la base
\((\overrightarrow{x_{1}},\overrightarrow{y_{1}},\overrightarrow{z_{0}})\)
, le
moment dynamique de
\(S_{3}\)
dans son mouvement par rapport à
\(R_{0}\)
exprimé en
\(O\)
:</p>
$$\begin{equation}
\overrightarrow{\delta_{(O,S_{3}/R_{0})}}
\end{equation}$$
]]></text></questiontext><answer format="html" fraction="-50.0"><text><![CDATA[
\(A_{3}(\dot{\omega}_{x}\overrightarrow{x_{1}}+\omega_{x}\dot{\theta}_{1}%
\overrightarrow{y_{1}})+[(C_{3}+m_{3}\lambda^{2})\ddot{\theta}_{1}+2m_{3}\dot{%
\lambda}\lambda\dot{\theta}_{1}]\overrightarrow{z_{0}}\)
]]></text><fraction>-50.0</fraction></answer><answer format="html" fraction="-50.0"><text><![CDATA[
\(C_{3}\ddot{\theta}_{1}\overrightarrow{z_{0}}\)
]]></text><fraction>-50.0</fraction></answer><answer format="html" fraction="100.0"><text><![CDATA[
\(A_{3}\dot{\omega}_{x}\overrightarrow{x_{1}}+C_{3}\ddot{\theta}_{1}%
\overrightarrow{z_{0}}\)
]]></text><fraction>100.0</fraction></answer><answer format="html" fraction="-50.0"><text><![CDATA[
\(A_{3}(\dot{\omega}_{x}\overrightarrow{x_{1}}+\omega_{x}\dot{\theta}_{1}%
\overrightarrow{y_{1}})+(C_{3}+m_{3}\lambda^{2})\ddot{\theta}_{1}%
\overrightarrow{z_{0}}\)
]]></text><fraction>-50.0</fraction></answer><defaultgrade>1.0</defaultgrade><shuffleanswers>true</shuffleanswers><answernumbering>abc</answernumbering></question>
</quiz>
The XML file could be loaded in Moodle. The following question is obtained:
But if you update the question or parameters of the question in Moodle (for instance only by clicking on Enregistrer les modifications et continuer
(Save and continue
), you obtain the following result:
As you see some parts of the answers disappear. This trouble seems to be due to two elements:
%
in the long equations that is not necessary.After upgrading to pyparsing 3.0.7, I get the following error when running amc2moodle
Traceback (most recent call last):
File "/usr/local/bin/amc2moodle", line 22, in <module>
from amc2moodle.amc2moodle import amc2moodle_class as a2m
File "/home/USER/.local/lib/python3.8/site-packages/amc2moodle/amc2moodle/amc2moodle_class.py", line 22, in <module>
from ..amc2moodle import convert
File "/home/USER/.local/lib/python3.8/site-packages/amc2moodle/amc2moodle/convert.py", line 29, in <module>
from ..utils.calculatedParser import *
File "/home/USER/.local/lib/python3.8/site-packages/amc2moodle/utils/calculatedParser.py", line 11, in <module>
from pyparsing import Word, alphas, nums, alphas, alphanums, Char, oneOf,\
ImportError: cannot import name '_flatten' from 'pyparsing' (/usr/local/lib/python3.8/dist-packages/pyparsing/__init__.py)
Regards
Prepare sources and deploy on pypi.
The local scoring is not taken into account anymore since the xpath search was performed only for first level child nodes.
We need to add stricter tests.
This has been fixed in feature-amc2moodle-addquestiontype branch and the issue will be solved after its merging.
I tried several conversion from moodle to amc, and every tex file ends weirdly, I tried with smaller category without success.
There is no error in the terminal.
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.
\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais,bloc,correc]{automultiplechoice}
\begin{document}
\element{test}{
uioygbjkbk, hhHLJmq jkjlkqjs qjlkjqs lk
aa
\begin{question}{qtest}
Loui
\begin{reponses}
\mauvaise{ hein}
\mauvaise{oh}
\bonne{ah}
\mauvaise{ouf}
\end{reponses}
\end{question}
}
\exemplaire{1}{
\restituegroupe{test}
}
\end{document}
One solution seems to add a linebreak before the `\begin{question}' command:
\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[francais,bloc,correc]{automultiplechoice}
\begin{document}
\element{test}{
uioygbjkbk, hhHLJmq jkjlkqjs qjlkjqs lk
aa
\begin{question}{qtest}
Loui
\begin{reponses}
\mauvaise{ hein}
\mauvaise{oh}
\bonne{ah}
\mauvaise{ouf}
\end{reponses}
\end{question}
}
\exemplaire{1}{
\restituegroupe{test}
}
\end{document}
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.