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
Release history Release notifications | RSS feed
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)
Built Distribution
clozer-0.0.1-py3-none-any.whl
(16.4 kB
view hashes)