From a7f56a04ee8173534aea229eb5a0deaf67d041a7 Mon Sep 17 00:00:00 2001 From: Miguel Barão Date: Sat, 21 Oct 2017 18:56:16 +0100 Subject: [PATCH] - review of an unexisting test returns http error code 404 not found. - questions are numbered from 1, and not counting information panels. --- BUGS.md | 10 ++++------ serve.py | 6 ++++-- templates/question.html | 2 +- templates/review-question-checkbox.html | 2 +- templates/review-question.html | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/BUGS.md b/BUGS.md index bb024e3..d1cd111 100644 --- a/BUGS.md +++ b/BUGS.md @@ -1,13 +1,11 @@ # BUGS -- markdown no teste nao funciona -- numeracao das perguntas do teste esta a contar com paineis informativos... +- qual a diferenca entre md_to_html e md_to_html_review, parece desnecessario haver dois. - servir imagens das perguntas - como alterar configuracao para mostrar logs de debug? - hints nao funciona - uniformizar question.py com a de aprendizations... -- Review de um teste que foi apagado rebenta. - permitir eliminar teste a decorrer de modo a que o aluno possa recomeçar (e.g. noutro browser) - servidor nao esta a lidar com eventos scroll/resize. ignorar? @@ -19,11 +17,8 @@ node_modules/mathjax-node-cli/bin/tex2svg '\sqrt{x}' usar isto para gerar svg que passa a fazer parte do texto da pergunta (markdown suporta tags svg?) - - - Gerar pdf's com todos os testes no final (pdfkit). - manter registo dos unfocus durante o teste e de qual a pergunta visivel nesse momento - - permitir varios testes, aluno escolhe qual o teste que quer fazer. - se ocorrer um erro na correcçao avisar aluno para contactar o professor. - abrir o teste numa janela maximizada e que nao permite que o aluno a redimensione/mova? @@ -38,6 +33,9 @@ # FIXED +- Review de um teste que foi apagado rebenta. +- numeracao das perguntas do teste esta a contar com paineis informativos... +- markdown no teste nao funciona - review de um teste nao funciona (hardcoded...) - testar SSL - text-numeric não está a gerar a pergunta. faltam templates? diff --git a/serve.py b/serve.py index a0b65c1..48e89d4 100755 --- a/serve.py +++ b/serve.py @@ -186,9 +186,11 @@ class ReviewHandler(BaseHandler): self.redirect('/') # FIXME 404 not found? test_id = self.get_query_argument('test_id', None) - # FIXME if test_id does not exist... + try: + fname = self.testapp.get_json_filename_of_test(test_id) + except: + raise tornado.web.HTTPError(404, 'Test ID not found.') - fname = self.testapp.get_json_filename_of_test(test_id) try: f = open(path.expanduser(fname)) except FileNotFoundError: # FIXME EnvironmentError? diff --git a/templates/question.html b/templates/question.html index 0e8543e..734abff 100644 --- a/templates/question.html +++ b/templates/question.html @@ -3,7 +3,7 @@ {% block question %}
- {{ i+1 }}. {{ q['title'] }} + {{ q['number'] }}. {{ q['title'] }}
Classificar  diff --git a/templates/review-question-checkbox.html b/templates/review-question-checkbox.html index a53e145..81d1429 100644 --- a/templates/review-question-checkbox.html +++ b/templates/review-question-checkbox.html @@ -33,4 +33,4 @@ {% end %} -{% end %} \ No newline at end of file +{% end %} diff --git a/templates/review-question.html b/templates/review-question.html index c82b402..d34f87d 100644 --- a/templates/review-question.html +++ b/templates/review-question.html @@ -4,7 +4,7 @@
- {{ i+1 }}. {{ q['title'] }} + {{ q['number'] }}. {{ q['title'] }}
Classificar  {% if q['answer'] is not None %} @@ -17,7 +17,7 @@

- {{ q['text'] }} + {{ md(q['text'], q) }}

{% block answer %}{% end %} -- libgit2 0.21.2