Commit d378e701472c3369e79525e7466f1298f2d9798f
1 parent
9caa0ee3
Exists in
master
and in
1 other branch
fixed review when test_id is not valid.
Showing
2 changed files
with
5 additions
and
5 deletions
Show diff stats
BUGS.md
1 | 1 | ||
2 | # BUGS | 2 | # BUGS |
3 | 3 | ||
4 | -- self.testapp.get_json_filename_of_test(test_id) retorna None quando test_id nao existe. | ||
5 | - a revisao do teste não mostra as imagens. | 4 | - a revisao do teste não mostra as imagens. |
6 | - se aluno tem teste activo e é allowed uma segunda vez, deve manter o mesmo teste. adicionar opcao para eliminar um teste em curso. | 5 | - se aluno tem teste activo e é allowed uma segunda vez, deve manter o mesmo teste. adicionar opcao para eliminar um teste em curso. |
7 | - melhorar o botao de autorizar (desliga-se), usar antes um botao? | 6 | - melhorar o botao de autorizar (desliga-se), usar antes um botao? |
@@ -61,6 +60,7 @@ ou usar push (websockets?) | @@ -61,6 +60,7 @@ ou usar push (websockets?) | ||
61 | 60 | ||
62 | # FIXED | 61 | # FIXED |
63 | 62 | ||
63 | +- self.testapp.get_json_filename_of_test(test_id) retorna None quando test_id nao existe. | ||
64 | - o eventloop está a bloquear. correção do teste é blocking. usar threadpoolexecutor? | 64 | - o eventloop está a bloquear. correção do teste é blocking. usar threadpoolexecutor? |
65 | - substituir get_event_loop por get_runnint_loop (ver https://docs.python.org/3/library/asyncio-eventloop.html) | 65 | - substituir get_event_loop por get_runnint_loop (ver https://docs.python.org/3/library/asyncio-eventloop.html) |
66 | - review nao esta a funcionar | 66 | - review nao esta a funcionar |
serve.py
@@ -274,10 +274,10 @@ class ReviewHandler(BaseHandler): | @@ -274,10 +274,10 @@ class ReviewHandler(BaseHandler): | ||
274 | def get(self): | 274 | def get(self): |
275 | test_id = self.get_query_argument('test_id', None) | 275 | test_id = self.get_query_argument('test_id', None) |
276 | logging.info(f'Review test {test_id}.') | 276 | logging.info(f'Review test {test_id}.') |
277 | - try: | ||
278 | - fname = self.testapp.get_json_filename_of_test(test_id) # FIXME is returning None if nonexistent | ||
279 | - except: | ||
280 | - raise tornado.web.HTTPError(404, 'Test ID not found.') | 277 | + fname = self.testapp.get_json_filename_of_test(test_id) |
278 | + | ||
279 | + if fname is None: | ||
280 | + raise tornado.web.HTTPError(404) # Not Found | ||
281 | 281 | ||
282 | try: | 282 | try: |
283 | f = open(path.expanduser(fname)) | 283 | f = open(path.expanduser(fname)) |