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.choices.append(Choice('Yes', 100.00, 'Correct, horse!'))
mc.choices.append(Choice('No', -100.00, 'Na-ahh'))
mc.choices.append(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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quizpy-0.0.1.tar.gz.
File metadata
- Download URL: quizpy-0.0.1.tar.gz
- Upload date:
- Size: 19.6 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4395fbcf9076666a6d5fba1493301ce47b068075ca7c9c17d16d4bbc7f2b25d
|
|
| MD5 |
eb2a0f22e8fdfe4f2da92bf5105c68d9
|
|
| BLAKE2b-256 |
e83758bc19b6825f410410c231dfeecbe902986f0b6b2fc5779eb28d97b9c2be
|
File details
Details for the file quizpy-0.0.1-py3-none-any.whl.
File metadata
- Download URL: quizpy-0.0.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
143eca4255c5a4c29faeccd98df59b37e20bef30d5fc4fa6202082290e50b3f2
|
|
| MD5 |
022b41260206ffcd2fc50bf04c831c6f
|
|
| BLAKE2b-256 |
d8e3ace57898ed9f35d4f75fad92746c6e1c09b83be408a1cdcb3e9d2a73746d
|