Skip to main content

Multiple choice quiz generation and grading

Project description

mcqpy

codecov

Generate and grade interactive multiple-choice quiz PDF documents. Rendered documents with

  • LaTeX formatting - including for math/equations.
  • Include figures from files or from links.
  • Code snippets with highlighted code.
  • Headers and footers.

Easily grade hundreds of quizzes with grades exported to .xlsx or .csv while obtaining question-level statistics.

Example

The simplest way to use mcqpy is through the command line interface (CLI). A project can be initialized like so

mcqpy init <PROJECT_NAME>

Which will create a directory <PROJECT_NAME> containing the following:

  • config.yaml: Overall configuration of the project, including author, document name, header, footer and preface options.
  • questions/: A directory where the project expects question .yaml files to be located.
  • output/: Where the built documents will be put.
  • submissions/: A directory where submitted quizzes should be put for grading.

For a quiz to be interesting it needs questions, the template structure of a question can be created using

mcqpy question init <QUESTION_PATH>

where <QUESTION_PATH> could be questions/q1.yaml. Once the desired number of questions have been written the quiz can be compiled using

mcqpy build 

Which produces a number of files in the output/ directory the important ones being

  • <NAME>.pdf: The quiz document
  • <NAME>_solution.pdf: A human readable solution key to all questions contained in the quiz.
  • <NAME>_manifest.json: Quiz key used by mcqpy to grade quizzes.

The <NMAE>.pdf document can be distributed to quiz takers through any means and once returned and placed in the submissions/ directory be graded by the program. A number of test submissions can be created using

mcqpy test-autofill -n 50 

Which here generates 50 randomly filled quizzes. To grade run

mcqpy grade -a 

Which will produce the files <NAME>_grades.xlsx containing the grades of all submissions and analysis/<NAME>_analysis.pdf containing statistics about overall point distributions as well as question level statistics.

Installation

mcqpy requires Python, a small number of Python packages and a working LaTeX installation.

Installing mcqpy in a venv.

If you have a working Python installation we recommend installing mcqpy in a suitable virtual environment (venv) using pip

pip install git+https://github.com/au-mbg/mcqpy.git

Installing Python & mcqpy.

If you do not have a suitable Python version, uv can be recommended for installing and managing Python, see Installing uv. With uv installed you can create a venv with mcqpy using

uv venv
source .venv/bin/activate  # On Mac/Linux
uv pip install git+https://github.com/au-mbg/mcqpy.git

Install LaTeX

You will also need a working LaTeX installation, once mcqpy is installed you can check for that using

mcqpy check-latex

Which will output the versions of pdflatex and latexmk if they are installed, if not you should install an OS appropriate LaTeX distribution for example from one of these sources:

  • macOS: MacTeX
  • Windows: TeX Live or MiKTeX
  • Linux: TeX Live (usually available through your package manager, e.g., sudo apt install texlive-full on Ubuntu/Debian)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcqpy-0.2.3.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcqpy-0.2.3-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file mcqpy-0.2.3.tar.gz.

File metadata

  • Download URL: mcqpy-0.2.3.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcqpy-0.2.3.tar.gz
Algorithm Hash digest
SHA256 3442e4192191433f2f5020b2bf2bc25b79629b737d810566c99c94a39baecd3b
MD5 19812330f4c926d587685cdb33d78230
BLAKE2b-256 eaa5b8a9e09dcfd5aed822f9992a22be7fa63d9017a7d895ae28af8703019fdc

See more details on using hashes here.

File details

Details for the file mcqpy-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: mcqpy-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for mcqpy-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2ad23442e58f8c30062e60231884077837cd7af75e6fcc3c464a781790147de8
MD5 b20b908ce1e134d63a9343151079d2ec
BLAKE2b-256 c215c56a6f458e29e27fa59d18e74b81b8cc0f05829ef119ff8fc7f90f05a865

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page