Skip to main content

quizpy

This package allows you to create a Moodle Quiz in Python code, which then can be imported via the XML import. Stop fumbling around with the horrible moodle web interface! Start coding and use version control!

So far many of the existing question types are supported:

  • Multiple Choice
  • Multiple True-False
  • Numerical
  • ShortAnswer
  • Matching
  • Drag & Drop on Images
  • Cloze
  • Essay
  • Descriptions

Installation

Quizpy is available on PyPi and can be installed via pip:

pip install quizpy

Usage

A moodle quiz (more specifically a question catalogue) consists of multiple categories that need to be filled with questions. Each Question has at least a title, a question text and some default points (which can be scaled in the actual quiz on moodle). Further customizations depend on the question type.

A minimal 2-question example might look like this:

from quizpy import Quiz, Category, MultipleChoice, Essay, Choice

mc = MultipleChoice("Question Title", 'Is this a question?', 1.0)
mc.add_choice('Yes', 100.00, 'Correct, horse!')
mc.add_choice('No', -100.00, 'Na-ahh')
mc.add_choice('Maybe?', 0.0, 'Na-ahh')

blabber = Essay("Psychology Question", "How does coding an exam make you feel?", 1.0, 
                response_template="Great!")

example_quiz = Quiz()

example_questions = example_quiz.add_category("Example questions")
example_questions.questions.extend([mc, blabber])


example_quiz.export('example_quiz.xml')

Documentation

A full documentation can be found on ReadTheDocs. Please, also have a look in the examples folder to quickly see how a question type is used.

Metadata

Release files for quizpy 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quizpy 0.0.4
File Size Uploaded
quizpy-0.0.4.tar.gz 24.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quizpy 0.0.4
File Interpreter ABI Platform
quizpy-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 53.2 kB

Release files / quizpy-0.0.4.tar.gz

Download URL quizpy-0.0.4.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
af8e2d135ef3cd0b7cbadf65ffe52147646cae182d402cd6bb4f972f4ec21ae8
BLAKE2b-256 checksum
How to use checksums
765f8556c0ba6ca42b63da9991019214e841a97fc16a52c36218065d9d1f12a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.7

Release files / quizpy-0.0.4-py3-none-any.whl

Download URL quizpy-0.0.4-py3-none-any.whl
Size 28.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb18b5d991dab5839393ce8e470eb6bb2803317a6a19e32b39e5f36ec2864758
BLAKE2b-256 checksum
How to use checksums
d5ad35a21c321d0eabe52ad69cf4e305903116a484a89b6d6968c5fb0bb8f061
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page