Skip to content

CLI Reference

mcqpy

Command line interface for mcqpy.

Usage:

mcqpy [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--version boolean Show the version and exit. False
--help boolean Show this message and exit. False

Subcommands

  • build: Build the quiz PDF from question files based on the provided configuration.
  • check-latex: Check LaTeX installation and configuration.
  • export: Commands for exporting browser-ready quiz artifacts.
  • grade: Grade student submissions.
  • init: Initialize a new quiz project
  • question:
  • utils:

build

Build the quiz PDF from question files based on the provided configuration. This command reads the quiz configuration, selects questions from the question bank, and generates the quiz PDF along with a solution PDF.

Usage:

mcqpy build [OPTIONS]

Options:

Name Type Description Default
-c, --config path Path to the config file config.yaml
--help boolean Show this message and exit. False

check-latex

Check LaTeX installation and configuration.

Usage:

mcqpy check-latex [OPTIONS]

Options:

Name Type Description Default
--help boolean Show this message and exit. False

export

Commands for exporting browser-ready quiz artifacts.

Usage:

mcqpy export [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Subcommands

  • decode-token: Decode a quiz token to its public URL.
  • encode-token: Encode a public quiz bundle URL.
  • web: Export a static web quiz bundle.

decode-token

Decode a quiz token to its public URL.

Usage:

mcqpy export decode-token [OPTIONS] TOKEN

Options:

Name Type Description Default
--help boolean Show this message and exit. False

encode-token

Encode a public quiz bundle URL.

Usage:

mcqpy export encode-token [OPTIONS] URL

Options:

Name Type Description Default
--help boolean Show this message and exit. False

web

Export a static web quiz bundle.

Usage:

mcqpy export web [OPTIONS]

Options:

Name Type Description Default
-c, --config path Path to the quiz config file. config.yaml
-o, --output-dir path Directory for the exported bundle. Defaults to output/web//. None
--asset-base-url text Optional published base URL used to rewrite copied local assets. None
--help boolean Show this message and exit. False

grade

Grade student submissions. Generates a grade report in the specified format (Excel or CSV). Students submissions are expected to be in submission directory specified in the config file.

Usage:

mcqpy grade [OPTIONS]

Options:

Name Type Description Default
-c, --config path Path to the config file config.yaml
-v, --verbose boolean Enable verbose output False
-f, --file-format choice (xlsx | csv) Output format for the grades xlsx
-a, --analysis boolean Generate question analysis reports False
--help boolean Show this message and exit. False

init

Initialize a new quiz project

Usage:

mcqpy init [OPTIONS] NAME

Options:

Name Type Description Default
-f, --file-name text Name of the output PDF file quiz.pdf
-mqd, --make-questions-directory boolean Create a questions directory True
-o, --output-directory text Directory for output files output
-s, --submission-directory text Directory for student submissions submissions
--help boolean Show this message and exit. False

question

Commands related to question management.

Usage:

mcqpy question [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Subcommands

  • check-tags: Check tags in questions
  • init: Initialize question file.
  • render: Render a question as PDF. Useful to check LaTeX formatting.
  • validate: Validate question files

check-tags

Check tags in questions

Usage:

mcqpy question check-tags [OPTIONS] PATH

Options:

Name Type Description Default
--help boolean Show this message and exit. False

init

Initialize question file.

Usage:

mcqpy question init [OPTIONS] PATH

Options:

Name Type Description Default
--help boolean Show this message and exit. False

render

Render a question as PDF. Useful to check LaTeX formatting.

Usage:

mcqpy question render [OPTIONS] PATH

Options:

Name Type Description Default
--help boolean Show this message and exit. False

validate

Validate question files

Usage:

mcqpy question validate [OPTIONS] [PATHS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

utils

Utility commands for MCQPy.

Usage:

mcqpy utils [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Subcommands

  • autofill: Make answered versions of quiz to test mcqpy functionality

autofill

Make answered versions of quiz to test mcqpy functionality

Usage:

mcqpy utils autofill [OPTIONS]

Options:

Name Type Description Default
-c, --config path Path to the config file config.yaml
-n, --num-forms integer Number of filled forms to generate 10
--correct boolean Fill forms with correct answers False
--help boolean Show this message and exit. False