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')

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.3.linux-x86_64.tar.gz (24.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.3-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file quizpy-0.0.3.linux-x86_64.tar.gz.

File metadata

  • Download URL: quizpy-0.0.3.linux-x86_64.tar.gz
  • Upload date:
  • Size: 24.5 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.3.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 6e86565e4d5ec3f45dd734c721092abf398e644d0247f7839052b0e05ba044bf
MD5 95282a179b8473da7b28dfa37cb3096b
BLAKE2b-256 736ddcbe44e953f2cac0be2c21a0b16a374213472ac6e9071cafe14377202748

See more details on using hashes here.

File details

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

File metadata

  • Download URL: quizpy-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 28.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e8b6bebfa62bf0f892cc99f5f62173838a90e0d31fa9c6b460d2ecfefc040208
MD5 8ecb9b0caace51ae0cc9109e47ba62a8
BLAKE2b-256 7f88f2f08b4493b171e14950cde3eef6f75971cdd6998039ec6e5c4ec270670b

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