diff --git a/BUGS.md b/BUGS.md index 9ce963e..639e50a 100644 --- a/BUGS.md +++ b/BUGS.md @@ -1,9 +1,9 @@ # BUGS +- on start topic, logs show questionhandler.get() twice. - generators e correct scripts que durem muito tempo podem bloquear o loop do tornado? - detect questions in questions.yaml without ref -> error ou generate default. -- topicos virtuais nao deveriam aparecer. na construção da árvore os sucessores seriam ligados directamente aos predecessores. - Criar outra estrutura organizada em capítulos (conjuntos de tópicos). Permitir capítulos de capítulos, etc. talvez usar grafos de grafos... - session management. close after inactive time. - generators not working: bcrypt (ver blog) @@ -11,6 +11,7 @@ # TODO +- radio e checkboxes, aceitar numeros como seleccao das opcoes. - each topic only loads a sample of K questions (max) in random order. - servir imagens/ficheiros. - pertuntas tipo tristate: (sim, não, não sei diff --git a/knowledge.py b/knowledge.py index 28d32c9..2399ce2 100644 --- a/knowledge.py +++ b/knowledge.py @@ -54,7 +54,7 @@ class StudentKnowledge(object): def unlock_topics(self): # minimum level that the dependencies of a topic must have # for the topic to be unlocked. - min_level = 0.2 + min_level = 0.01 for topic in self.topic_sequence: if topic not in self.state: # if locked @@ -89,8 +89,9 @@ class StudentKnowledge(object): factory = self.deps.node[topic]['factory'] questionlist = self.deps.node[topic]['questions'] - self.questions = [factory[qref].generate() for qref in questionlist] self.finished_questions = [] + self.questions = [factory[qref].generate() for qref in questionlist] + logger.debug(f'Total: {len(self.questions)} questions') try: self.current_question = self.questions.pop(0) # FIXME crash if empty diff --git a/learnapp.py b/learnapp.py index 9ed8e6a..03c3414 100644 --- a/learnapp.py +++ b/learnapp.py @@ -58,6 +58,8 @@ class LearnApp(object): if bcrypt.checkpw(pw.encode('utf-8'), student.password): if uid in self.online: logger.warning(f'User "{uid}" already logged in, overwriting state') + else: + logger.info(f'User "{uid}" logged in successfully') tt = s.query(StudentTopic).filter(StudentTopic.student_id == uid) state = {t.topic_id: @@ -71,7 +73,6 @@ class LearnApp(object): 'name': student.name, 'state': StudentKnowledge(self.deps, state=state) } - logger.info(f'User "{uid}" logged in successfully') return True else: diff --git a/static/css/topic.css b/static/css/topic.css index ef7e5f9..79467bc 100644 --- a/static/css/topic.css +++ b/static/css/topic.css @@ -1,20 +1,20 @@ .progress { /*position: fixed;*/ top: 0; - height: 90px; + height: 85px; border-radius: 0px; } body { margin: 0; padding-top: 0px; - margin-bottom: 90px; /* Margin bottom by footer height */ + margin-bottom: 120px; /* Margin bottom by footer height */ } .footer { position: absolute; bottom: 0; width: 100%; - height: 70px; + height: 90px; line-height: 60px; /*background-color: #f5f5f5;*/ } -- libgit2 0.21.2