Commit d165ac7971f510bfe479e8fc813e83b3c11c9d2f
1 parent
ce0b2f4d
Exists in
master
and in
1 other branch
- changed default correct in checkbox questions so that they can be correct if not defined.
Showing
2 changed files
with
4 additions
and
4 deletions
Show diff stats
questions.py
... | ... | @@ -148,7 +148,7 @@ class QuestionCheckbox(Question): |
148 | 148 | # set defaults if missing |
149 | 149 | self.set_defaults({ |
150 | 150 | 'text': '', |
151 | - 'correct': [0.0] * n, # useful for questionaries | |
151 | + 'correct': [1.0] * n, # useful for questionaries | |
152 | 152 | 'shuffle': True, |
153 | 153 | 'discount': True, |
154 | 154 | 'choose': n, # number of options | ... | ... |
serve.py
... | ... | @@ -16,7 +16,7 @@ import functools |
16 | 16 | import tornado.ioloop |
17 | 17 | import tornado.web |
18 | 18 | import tornado.httpserver |
19 | -from tornado import template, iostream | |
19 | +from tornado import iostream | |
20 | 20 | |
21 | 21 | # this project |
22 | 22 | from learnapp import LearnApp |
... | ... | @@ -303,8 +303,8 @@ class QuestionHandler(BaseHandler): |
303 | 303 | |
304 | 304 | # ------------------------------------------------------------------------- |
305 | 305 | def signal_handler(signal, frame): |
306 | - r = input(' --> Stop webserver? (yes/no) ') | |
307 | - if r in ('yes', 'YES'): | |
306 | + r = input(' --> Stop webserver? (yes/no) ').lower() | |
307 | + if r == 'yes': | |
308 | 308 | tornado.ioloop.IOLoop.current().stop() |
309 | 309 | logging.critical('Webserver stopped.') |
310 | 310 | sys.exit(0) | ... | ... |