diff --git a/README.md b/README.md index e218891..0d33097 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ - **from** [moodle questions (XML format)](https://docs.moodle.org/38/en/Moodle_XML_format) **to** [auto-multiple-choice](https://www.auto-multiple-choice.net) LaTeX quizzes, see details in the [moodle2amc README file](amc2moodle/moodle2amc/README.md). The conversion supports equations, tables, figures and standard text formatting. -This software is written in python and in XSLT, thus the conversion step is OS independent. It has been tested for moodle 3.x and auto-multiple-choice (v1.0.3-v1.5) and the conversion step is OS independent. +This software is written in python and in XSLT, thus the conversion step is OS independent. It has been tested for moodle 3.x or 4.x and auto-multiple-choice (v1.0.3-v1.5). Note that [auto-multiple-choice](https://www.auto-multiple-choice.net) (amc) LaTeX format is very convenient, and can be used for preparing multiple choice questions off-line and avoiding moodle web GUI. @@ -23,7 +23,7 @@ To install `amc2moodle` as a python package on linux or macOS platform, follow t - install `imageMagick`, useful to convert image files (*.eps, *.pdf, ...) into png - Ubuntu: `sudo apt-get install imagemagick` - MacOS: `brew install imagemagick` (see [`ImageMagick` website](https://imagemagick.org/script/download.php) for more details ) - - install [`LaTeXML`](http://dlmf.nist.gov/LaTeXML) [tested with version 0.8.1] This program does the first step of the conversion into XML + - install [`LaTeXML`](http://dlmf.nist.gov/LaTeXML) [tested with version >= 0.8.1] This program does the first step of the conversion into XML - Ubuntu: `sudo apt-get install latexml` - see also [LaTeXML wiki](https://github.com/brucemiller/LaTeXML/wiki/Installation-Guides) or [install notes](https://dlmf.nist.gov/LaTeXML/get.html) that all the dependencies are installed (perl, latex, imagemagick). - install `xmlindent` [optional]. This program can be used to indent well the XML file diff --git a/amc2moodle/_version.py b/amc2moodle/_version.py index d92527a..01ba715 100644 --- a/amc2moodle/_version.py +++ b/amc2moodle/_version.py @@ -1 +1 @@ -__version__ = '2.10.3' +__version__ = '2.10.4' diff --git a/amc2moodle/amc2moodle/automultiplechoice.sty.ltxml b/amc2moodle/amc2moodle/automultiplechoice.sty.ltxml index bcc2362..0e2834a 100644 --- a/amc2moodle/amc2moodle/automultiplechoice.sty.ltxml +++ b/amc2moodle/amc2moodle/automultiplechoice.sty.ltxml @@ -2,13 +2,24 @@ package LaTeXML::Package::pool; # to put new subs & variables in common pool use LaTeXML::Package; # to load these definitions use strict; # good style use warnings; - +use version; # Use to check version of LateXML # def les notes, comparer avec les arguemens optionnels etc # comment ajouter des tags? # comment imposer de neester les environenements? -# ici pas de mise en forme, jsute des changement de case. +# ici pas de mise en forme, juste des changements de case. # \usepackage[francais,bloc,completemulti]{automultiplechoice} +# Version 0.8.8 of LateXML introduce breaking change. +my $ltx_para_inline = ''; +if( version->parse($LaTeXML::VERSION) >= version->parse('0.8.8') ) { + $ltx_para_inline = 'ltx:inline-logical-block'; + print 'Found a version of LaTeXML >= 0.8.8, use : ', $ltx_para_inline, "\n"; +} else { + $ltx_para_inline = 'ltx:inline-para'; + print "Found a legacy version of LaTeXML, use : ", $ltx_para_inline, "\n" ; +} + + DefMacro('\@ifundefined{}{}{}',''); DefMacro('\cleargroup',''); @@ -65,17 +76,18 @@ DefConstructor('\includesounds{}',"#body", +DefEnvironment('{question}{}',"<$ltx_para_inline>#body", properties => sub { StepCounter('questions') }, beforeConstruct => sub { $_[0]->maybeCloseElement('ltx:para'); }); # question multiple -DefEnvironment('{questionmult}{}',"#body", +DefEnvironment('{questionmult}{}',"<$ltx_para_inline>#body", properties => sub { StepCounter('questions') }, beforeConstruct => sub { $_[0]->maybeCloseElement('ltx:para'); }); # questionmultx is the same as questionmult, except it does not display \multiSymbole -DefEnvironment('{questionmultx}{}',"#body", +DefEnvironment('{questionmultx}{}',"<$ltx_para_inline>#body", properties => sub { StepCounter('questions') }, beforeConstruct => sub { $_[0]->maybeCloseElement('ltx:para'); }); DefEnvironment('{examcopy}[]',""); # alternative to onecopy, # on supprime la partie construction du sujet si présente + # =================================================================== # REPONSE # Pas exploité, simple copie diff --git a/amc2moodle/amc2moodle/transform2html.xslt b/amc2moodle/amc2moodle/transform2html.xslt index fb2e41e..4ed8064 100644 --- a/amc2moodle/amc2moodle/transform2html.xslt +++ b/amc2moodle/amc2moodle/transform2html.xslt @@ -241,7 +241,7 @@ Single
does the trick -->
- +