From d165ac7971f510bfe479e8fc813e83b3c11c9d2f Mon Sep 17 00:00:00 2001 From: Miguel Barao Date: Fri, 6 Apr 2018 10:49:54 +0100 Subject: [PATCH] - changed default correct in checkbox questions so that they can be correct if not defined. --- questions.py | 2 +- serve.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/questions.py b/questions.py index 4bf44a2..4f17fa1 100644 --- a/questions.py +++ b/questions.py @@ -148,7 +148,7 @@ class QuestionCheckbox(Question): # set defaults if missing self.set_defaults({ 'text': '', - 'correct': [0.0] * n, # useful for questionaries + 'correct': [1.0] * n, # useful for questionaries 'shuffle': True, 'discount': True, 'choose': n, # number of options diff --git a/serve.py b/serve.py index 76436ea..26fd166 100755 --- a/serve.py +++ b/serve.py @@ -16,7 +16,7 @@ import functools import tornado.ioloop import tornado.web import tornado.httpserver -from tornado import template, iostream +from tornado import iostream # this project from learnapp import LearnApp @@ -303,8 +303,8 @@ class QuestionHandler(BaseHandler): # ------------------------------------------------------------------------- def signal_handler(signal, frame): - r = input(' --> Stop webserver? (yes/no) ') - if r in ('yes', 'YES'): + r = input(' --> Stop webserver? (yes/no) ').lower() + if r == 'yes': tornado.ioloop.IOLoop.current().stop() logging.critical('Webserver stopped.') sys.exit(0) -- libgit2 0.21.2