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.2.tar.gz (28.0 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.2-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcqpy-0.2.2.tar.gz
  • Upload date:
  • Size: 28.0 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.2.tar.gz
Algorithm Hash digest
SHA256 14e6676c917673b7fb2ff3ec90fa9baf7579b8cd26d33c7ad3b7563322967f77
MD5 b9e51619d3cd0849e31814c34581f46f
BLAKE2b-256 005955468797be6d5e5ab37693fc0534240167eb990acb20c7bf3960e8c7afca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mcqpy-0.2.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 49ed0a142ee2a538b52f1dd166cea42e049c58c68bbd9f2531921a6b56fec3b4
MD5 f84c228dee10a4da8ae45c7775483cba
BLAKE2b-256 c3ad71b57104bcb81cbc627595acbcb8c5f1c5e50dccb3a33b65e40a0027caa9

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