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_questions = Category("Example questions")
example_questions.questions.extend([mc, blabber])

example_quiz = Quiz(categories=[example_questions])

example_quiz.export('example_quiz.xml')

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: quizpy-0.0.2.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for quizpy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 58d6925a9dc20284e6e683e3e3f27094ec43b98b5d904ea7583f9daccf6981e1
MD5 dde63751ddd74d3d09fb0122e4a4503f
BLAKE2b-256 bd9bb5231b995350e3910945849f17e0c91b13b5c1adaf966007dafd16e52065

See more details on using hashes here.

File details

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

File metadata

  • Download URL: quizpy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for quizpy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5f0e1b51d8a64737768c30b4479b5a9ba28764b0a20277bba2fe45f3d79197fc
MD5 cc6381e60a6107f39aa4d8e343c4c2d4
BLAKE2b-256 6e99f02282a6b861c4b5b9f6a9043ea6d7a8a4109b6dd89845ea6b09d7a02046

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