Coder Social home page Coder Social logo

genmq's Introduction

genmq

A Moodle quiz generator using LaTeX and the moodle.sty package with jinja2 templates

Generates Individualized Moodle Quizzes based on a LaTeX Template

Author: Colin Caprani, [email protected]

Overview

genmq is a python package that performs mail-merge like functionality to generate a Moodle quiz XML file for bulk upload. It uses a template latex file based on the moodle.sty package, and populates placeholder variables with entries from a prepared csv file to generate many variants of the template question. It can include the answers, precision, and feedback; all as described in the documentation for the moodle.sty package.

genmq can also split larger Moodle XML files into multiple files to facilitate uploading when there are file size limits.

Installation

genmq installs as a command into your system.

Using pip

pip install genmq

For development

Clone or download this repository to a local directory. Open a terminal in that directory (where this README will be found) and run:

pip install -e .

Typical Usage

For generating quizzes:

genmq -t [template].tex -c [database].csv

For splitting an existing large XML file:

genmq -s [moodle_quiz].xml

To see all arguments, run genmq --help.

genmq's People

Contributors

ccaprani avatar mayermelhem avatar

Stargazers

 avatar  avatar

Watchers

 avatar

genmq's Issues

Project is missing dependency information

Perhaps I am incorrect, but this project seems to be completely missing all the dependency information required for anyone to successfully use it.

Dependencies can be added to a pyproject.toml file as explained here.

This is important information, as (a) without it, a user has to look through the Python source code and laboriously work out what the dependencies were, and (b) often, a Python package will only work with particular versions of its dependencies.

Unnecessary triple compilation for pythontex-less templates.

In genquiz.py Line 170 calls for pdflatex, pythontex, and then pdflatex (conventional). However, if the latex template file has no pythontex environments present, the file is unnecessarily complied three times. Suggest adding a flag to indicate if file does not contain any pythontex (ie. having pythontex is default).

subprocess.call(cmd_pdflatex, shell=True)
subprocess.call(cmd_pythontex, shell=True)
subprocess.call(cmd_pdflatex, shell=True)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.