From 29ec441abd0843e70f1cdf15e5cd03921b944511 Mon Sep 17 00:00:00 2001 From: Miguel BarĂ£o Date: Mon, 20 Nov 2017 19:39:40 +0000 Subject: [PATCH] - remove prefix 'l' from student id on login --- questionfactory.py | 5 +++-- questions.py | 1 - serve.py | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/questionfactory.py b/questionfactory.py index 240de73..4214fb7 100644 --- a/questionfactory.py +++ b/questionfactory.py @@ -18,12 +18,13 @@ # An instance of an actual question is an object that inherits from Question() # # Question - base class inherited by other classes +# QuestionInformation - not a question, just a box with content # QuestionRadio - single choice from a list of options # QuestionCheckbox - multiple choice, equivalent to multiple true/false # QuestionText - line of text compared to a list of acceptable answers # QuestionTextRegex - line of text matched against a regular expression # QuestionTextArea - corrected by an external program -# QuestionInformation - not a question, just a box with content +# QuestionNumericInterval - line of text parsed as a float # base from os import path @@ -34,7 +35,7 @@ import logging -from questions import Question, QuestionRadio, QuestionCheckbox, QuestionText, QuestionTextRegex, QuestionNumericInterval, QuestionTextArea, QuestionInformation +from questions import QuestionRadio, QuestionCheckbox, QuestionText, QuestionTextRegex, QuestionNumericInterval, QuestionTextArea, QuestionInformation # setup logger for this module diff --git a/questions.py b/questions.py index eb42a66..167792f 100644 --- a/questions.py +++ b/questions.py @@ -1,5 +1,4 @@ - # base import random import re diff --git a/serve.py b/serve.py index 34f7ab1..5b6a95f 100755 --- a/serve.py +++ b/serve.py @@ -18,7 +18,7 @@ import tornado.httpserver from tornado import template, gen # project -from tools import load_yaml, md_to_html #, md_to_html_review +from tools import load_yaml, md_to_html from app import App, AppException @@ -72,6 +72,8 @@ class LoginHandler(BaseHandler): # @gen.coroutine def post(self): uid = self.get_body_argument('uid') + if uid.startswith('l'): # remove prefix 'l' + uid = uid[1:] pw = self.get_body_argument('pw') if self.testapp.login(uid, pw): -- libgit2 0.21.2