Skip to main content

A tool to generate cloze quizes with random values.

Project description

clozer

Prequisites

  • python3

Instalation

pip3 install clozer

Example

Python file (sumquiz.py):

import random

from clozer import Quiz, QuestionVar


class SumQuiz(Quiz):
    file = 'template.html'

    def __init__(self):
        super().__init__()
        self._name = 'SumQuiz' 

    @QuestionVar
    def A(self):
        return random.randint(1,10)

    @QuestionVar
    def B(self):
        return random.randint(1,10)

    @QuestionVar
    def C(self):
        return self.A + self.B


if __name__ == "__main__":
    quiz = SumQuiz()
    quiz.store()

Template (template.html):

<p>Solve:</p>
<p>{A}+{B}={{:NUMERIC:={C}}}</p>

Run: python3 sumquiz.py

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

clozer-0.0.1.tar.gz (15.5 kB view hashes)

Uploaded Source

Built Distribution

clozer-0.0.1-py3-none-any.whl (16.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