diff --git a/BUGS.md b/BUGS.md index ac8a6d0..c295dfa 100644 --- a/BUGS.md +++ b/BUGS.md @@ -1,19 +1,13 @@ BUGS: +- forçar reload das perguntas. - tabelas nas perguntas radio/checkbox não ocupam todo o espaço como em question. - 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. - - reportar comentarios após submeter. -- cada topico tem uma pagina begin e uma end? - pertuntas tipo tristate: (sim, não, não sei) -- animação no final de cada topico para se perceber a transição -- aumentar espaço a seguir às tabelas no texto -- guardar state cada vez que topico termina -- tabs em textarea nao funcionam correctamente (insere 1 espaco em vez de 4) -- textarea deve mostrar no html os valores iniciais de ans, se existir - detect questions in questions.yaml without ref -> error ou generate default. - error if demo.yaml has no topics - session management. close after inactive time. @@ -32,9 +26,15 @@ TODO: - pymips: activar/desactivar instruções - implementar servidor http com redirect para https. - usar codemirror no textarea +- ao fim de 3 tentativas com password errada, envia email com nova password. FIXED: +- tabs em textarea nao funcionam correctamente (insere 1 espaco em vez de 4) +- guardar state cada vez que topico termina +- textarea deve mostrar no html os valores iniciais de ans, se existirem +- aumentar espaço a seguir às tabelas no texto +- animação no final de cada topico para se perceber a transição - "<" is not escaped in markdown. - Está a mostrar a solução em 'comments'!!! - database: answers não tem referencia para o topico, so para question_ref diff --git a/demo/solar_system/questions.yaml b/demo/solar_system/questions.yaml index 96e8f58..cc21d04 100644 --- a/demo/solar_system/questions.yaml +++ b/demo/solar_system/questions.yaml @@ -1,3 +1,4 @@ +--- # --------------------------------------------------------------------------- - @@ -30,7 +31,7 @@ ref: saturn type: text-regex title: Sistema solar - text: O planeta do nosso sistema solar conhecido por ter aneis chama-se planeta... + text: O planeta do sistema solar conhecido por ter aneis é o planeta... correct: !regex '[Ss]aturno' # --------------------------------------------------------------------------- @@ -41,5 +42,6 @@ text: Escreva o nome dos três planetas mais próximos do Sol. (Exemplo `A, B e C`) correct: correct-first_3_planets.py # opcional + answer: Vulcano, Krypton, Plutão lines: 3 timeout: 5 diff --git a/learnapp.py b/learnapp.py index bd10828..6e0ae00 100644 --- a/learnapp.py +++ b/learnapp.py @@ -118,10 +118,9 @@ class LearnApp(object): a = s.query(StudentTopic).filter_by(student_id=uid, topic_id=finished_topic).one_or_none() if a is None: # insert new studenttopic into database - u = s.query(Student).get(uid) - a = StudentTopic(level=level, date=date) t = s.query(Topic).get(finished_topic) - a.topic = t + a = StudentTopic(level=level, date=date, topic=t) + u = s.query(Student).get(uid) u.topics.append(a) else: # update studenttopic in database @@ -177,9 +176,9 @@ class LearnApp(object): logger.critical(f'Database "{db}" not usable.') sys.exit(1) else: - logger.info(f'{n:4} students.') - logger.info(f'{m:4} topics.') - logger.info(f'{q:4} questions answered.') + logger.info(f'{n:6} students.') + logger.info(f'{m:6} topics.') + logger.info(f'{q:6} answers.') # ------------------------------------------------------------------------ # helper to manage db sessions using the `with` statement, for example @@ -297,6 +296,6 @@ def build_dependency_graph(config={}): q['path'] = fullpath tnode['factory'][q['ref']] = QFactory(q) - logger.info(f'{len(tnode["questions"]):4} questions from {tref}') + logger.info(f'{len(tnode["questions"]):6} from {tref}') return g diff --git a/templates/topic.html b/templates/topic.html index f5eef57..d72b282 100644 --- a/templates/topic.html +++ b/templates/topic.html @@ -47,8 +47,11 @@ background-color: #f5f5f5; } html { - position: relative; - min-height: 100%; + position: relative; + min-height: 100%; + } + textarea { + font-family: monospace; } @@ -131,7 +134,7 @@ } }); - // Process the response given by the server + // Process response given by the server function updateQuestion(response){ switch (response["method"]) { case "new_question": @@ -152,7 +155,7 @@ e.preventDefault(); postQuestion(); } - else if (e.keyCode === 9) { // tab + else if (e.keyCode == 9) { // tab e.preventDefault(); // prevent loosing focus // get caret position/selection var start = this.selectionStart; @@ -160,8 +163,7 @@ var value = $(this).val(); // set textarea value to: text before caret + tab + text after caret - $(this).val(value.substring(0, start) + " " + value.substring(end)); - + $(this).val(value.substring(0, start) + " " + " " + " " + " " + value.substring(end)); // put caret at right position again (add one for the tab) this.selectionStart = this.selectionEnd = start + 4; }}); -- libgit2 0.21.2