Skip to main content

Noodle-Quiz (Not Moodle Quiz generator) is a set of utilities to generate quizzes for Moodle

Project description

Noodle-Quiz

Noodle-Quiz (Not Moodle Quiz generator) is a set of utilities to generate quizzes for Moodle

Example usage

from noodle_quiz import Quiz
from noodle_quiz.question_types import Description, Numeric, MultipleChoice
from noodle_quiz.answer_types import NumericAnswer, MultipleChoiceAnswer
q = Quiz()
d = Description('Exercice 1', 'Description')
a = NumericAnswer(100, 4)
n = Numeric('Question #1', [a], 'Calculate 2+2')
ans1 = MultipleChoiceAnswer(50, 2)
ans2 = MultipleChoiceAnswer(50, -2)
ans3 = MultipleChoiceAnswer(-100, 4)
qcm = MultipleChoice('QCM1', 'Solve for x: $$x^2 = 4$$', [ans1, ans2, ans3], single_choice=False)
ansX = MultipleChoiceAnswer(100, 42)
ansY = MultipleChoiceAnswer(0, 'Not 42')
qcu = MultipleChoice('QCM2', 'What is the product of 7 by 8 ?', [ansX, ansY])
q.add_questions([d, n, qcm, qcu])
q.save_to_path('test.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

noodle_quiz-0.1.3.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

noodle_quiz-0.1.3-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page