Add licence, AGPL 3.0
This commit is contained in:
parent
789a4bb3fc
commit
51e2707219
2 changed files with 666 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ See http://moxquizz.de/ for the original implementation in TCL.
|
|||
from __future__ import unicode_literals, print_function
|
||||
from io import open
|
||||
import re
|
||||
import sys
|
||||
|
||||
|
||||
class Question:
|
||||
|
|
@ -286,11 +287,13 @@ class QuestionBank:
|
|||
|
||||
# A crappy test.
|
||||
if __name__ == '__main__':
|
||||
qb = QuestionBank('../questions.doctorlard.en')
|
||||
qb = QuestionBank('questions.doctorlard.en')
|
||||
for q in qb.questions:
|
||||
print(q.question)
|
||||
a = unicode(raw_input('A: '), 'utf8')
|
||||
#a = input('A: ') # Python 3
|
||||
if sys.version.startswith('2'):
|
||||
a = unicode(raw_input('A: '), 'utf8')
|
||||
else:
|
||||
a = input('A: ')
|
||||
if q.attempt(a):
|
||||
print("Correct!")
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue