Skip to main content

A package to create Moodle exams using Python

Project description

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.

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

quizpy-0.0.4.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

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

quizpy-0.0.4-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file quizpy-0.0.4.tar.gz.

File metadata

  • Download URL: quizpy-0.0.4.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for quizpy-0.0.4.tar.gz
Algorithm Hash digest
SHA256 af8e2d135ef3cd0b7cbadf65ffe52147646cae182d402cd6bb4f972f4ec21ae8
MD5 b91479d0df5883fb1f58afb3b8475331
BLAKE2b-256 765f8556c0ba6ca42b63da9991019214e841a97fc16a52c36218065d9d1f12a9

See more details on using hashes here.

File details

Details for the file quizpy-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: quizpy-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for quizpy-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cb18b5d991dab5839393ce8e470eb6bb2803317a6a19e32b39e5f36ec2864758
MD5 bc0460b72263172505b328f438998560
BLAKE2b-256 d5ad35a21c321d0eabe52ad69cf4e305903116a484a89b6d6968c5fb0bb8f061

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