Package: amc2moodle
amc2moodleamc2moodle, is a suite of tools to convert multiple choice questionnaires (MCQ)fromauto-multiple-choiceLaTeX quizzestomoodle questions (XML format), see details in theamc2moodle README file. Sinceamc2moodleuseLaTeXMLtoexpands LaTeX commands, it could beeasilyadapted to support most of LaTeX capabilities.frommoodle questions (XML format)toauto-multiple-choiceLaTeX quizzes, see details in themoodle2amc README file.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.Note thatauto-multiple-choice(amc) LaTeX format is very convenient, and can be used for preparing multiple choice questions off-line and avoiding moodle web GUI.InstallationA Docker image withamc2moodleand its dependencies is available atghcr.io/nennigb/amc2moodle.
Once the docker software is installed, this image allows to useamc2moodleonwindows plateformsor to add the resource isolation features on linux or macOS. For more information, see theamc2moodle' docker README.
To installamc2moodleas a python package on linux or macOS platform, follow the steps below.Before installing amc2moodle:install python (version >=3.5)installimageMagick, useful to convert image files (*.eps, *.pdf, ...) into pngUbuntu:sudo apt-get install imagemagickMacOS:brew install imagemagick(seeImageMagickwebsitefor more details )installLaTeXML[tested with version 0.8.1] This program does the first step of the conversion into XMLUbuntu:sudo apt-get install latexmlsee alsoLaTeXML wikiorinstall notesthat all the dependencies are installed (perl, latex, imagemagick).installxmlindent[optional]. This program can be used to indent well the XML fileUbuntu:sudo apt-get install xmlindentMacOS: not necessary. Script will usexmllintnatively available on MacOS.For MacOS users, most dependencies can be installed withbrewbutLaTeXMLinstallation can failed for some version. Please see the steps given in the install scriptworkflow.Install with pipRunpip install amc2moodlepip will download automatically the required files.or if you have download the sources, runpip install .in the root folder (wheresetup.pyis). This will automatically install other dependencies i.e.,lxml, andWand.
Alternatively, you can runpip install -e .to install it in editable mode, useful if git is used.Note: for Ubuntu users usepip3instead ofpipfor python3.UninstallationRunpip uninstall amc2moodleConversionThe program can be run in a shell terminal, for instance to convert anamc LaTeX file to moodle XMLamc2moodle input_Tex_file.tex -o output_file.xml -c catnameHelp and options can be obtained usingamc2moodle -hThen on moodle, go to the courseadministration\question bank\importand choose 'moodle XML format' and tick:If your grade are not conform to that you must use: 'Nearest grade if not listed' in import option in the moodle question bank(see below for details).
Examples of theamc2moodlepossibilities are given atQCM.pdfIf your original exam usesAMC-TXT syntax, you must first convert it to LaTeX before feeding it toamc2moodle. To convert an AMC-TXT file to LaTeX, generate the exam documents with AMC graphical interface as usual. AMC will generate a LaTeX version of your exam calledDOC-filtered.texinside the project directory, which you can pass toamc2moodle.In the same way, conversion frommoodle XML to amc LaTeX file, runmoodle2amc input_XML_file.xmlHelp and options can be obtained usingmoodle2amc -hThen the output LaTeX can be edited and included for creating amc exams. Examples of themoodle2amcpossibilities are givenhere.TroubleshootingIn case of problem, do not hesitate to ask for help ondiscussionsor to create anissues. Both binaries (amc2moodleandmoodle2amc) write full log in log files based on the name of the input file (_amc2moodle.logand_amc2moodle.logsuffixes are added on these files).'convert: not authorized..' see ImageMagick policy.xml file seeherebugs with tikz-LaTeXML in texlive 2019/2020: please update the followingperlmodulesParse::RecDescent,XML::LibXMLandXML::LibXSLTherewithcpanorcpanmin CLI.If LaTeXML doesn't know some LaTeX package and returnWarning:missing_file:package-name Can't find binding for package package-name, you can try to invoqueamc2moodlewith--includestylesflag.Related Projectauto-multiple-choice,  is a piece of software that can help you creating and managing multiple choice questionnaires (MCQ), with automated marking.TeX2Quiz, is a similar project to translate multiple choice quiz into moodle XML, without connection with AMC.moodle- Generating Moodle quizzes via LaTeX. A package for writing Moodle quizzes in LaTeX. In addition to typesetting the quizzes for proofreading, the package compiles an XML file to be uploaded to a Moodle server.moodle-mod-automultiplechoice- An interface to use AMC within Moodle.flatex- A Python script for "flattening" a nested LaTeX document by pulling in all the \input files. Part of this project has been reused in amc2moodle.pyexams,  It allows to eval code inside any jupyter kernel (like Sagemath, sympy, ...) and to export them in the moodle XML format.How to contribute ?If you want to contribute toamc2moodle, your are welcomed! Don't hesitate toask for help or share some tips ondiscussionsreport bugs, installation problems onissuespropose some enhancements in the code or in documentation throughpull requests(PR)create a moodle plugin for importsupport new kind of questionsadd support for other language (French and English are present) in AMC command...To ensure code homogeneity among contributors, we use a source-code analyzer (e.g.pylint).
Before submitting a PR, run the tests suite.LicenseThis file is part of amc2moodle, a tool to convert automultiplechoice quizzes to moodle questions.
amc2moodle is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
amc2moodle is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with amc2moodle.  If not, seehttps://www.gnu.org/licenses/.