Commit aab6a036ed2d3d51dda3b61c534dd55d26e9fb40

Authored by Miguel Barão
1 parent 216b2b5f
Exists in master and in 1 other branch dev

minor changes

1 1
2 # BUGS 2 # BUGS
3 3
  4 +- perguntas repetidas (mesma ref) dao asneira, porque a referencia é usada como chave em varios sitios e as chaves nao podem ser dupplicadas.
  5 + da asneira pelo menos na funcao get_questions_csv. na base de dados tem de estar registado tb o numero da pergunta, caso contrario é impossível saber a qual corresponde.
  6 +- show-ref nao esta a funcionar na correccao (pelo menos)
4 - algumas submissões ficaram em duplicado na base de dados. a base de dados deveria ter como chave do teste um id que fosse único desse teste particular (não um auto counter, nem ref do teste) 7 - algumas submissões ficaram em duplicado na base de dados. a base de dados deveria ter como chave do teste um id que fosse único desse teste particular (não um auto counter, nem ref do teste)
5 - guardar nota final grade truncado em zero e sem ser truncado (quando é necessário fazer correcções à mão às perguntas, é necessário o valor não truncado) 8 - guardar nota final grade truncado em zero e sem ser truncado (quando é necessário fazer correcções à mão às perguntas, é necessário o valor não truncado)
6 - internal server error quando em --review, download csv detalhado. 9 - internal server error quando em --review, download csv detalhado.
perguntations/app.py
@@ -343,10 +343,16 @@ class App(): @@ -343,10 +343,16 @@ class App():
343 .order_by(Question.student_id)\ 343 .order_by(Question.student_id)\
344 .all() 344 .all()
345 345
  346 + # first row of the csv will include student_id, date/time, and refs for
  347 + # all questions declared in the test
346 cols = ['Aluno', 'Início'] + \ 348 cols = ['Aluno', 'Início'] + \
347 [r for question in self.testfactory['questions'] 349 [r for question in self.testfactory['questions']
348 for r in question['ref']] 350 for r in question['ref']]
349 351
  352 + # tests is a dict of dicts: FIXME what about duplicate qrefs???
  353 + # { (student_id, time): {qref: grade, ...} }
  354 + # the key is a tuple (student_id, time) because the same student can
  355 + # repeat the same test multiple times (if the professor allows).
350 tests = {} 356 tests = {}
351 for question in grades: 357 for question in grades:
352 student, qref, qgrade = question[:2], *question[2:] 358 student, qref, qgrade = question[:2], *question[2:]
perguntations/serve.py
@@ -191,7 +191,7 @@ class LoginHandler(BaseHandler): @@ -191,7 +191,7 @@ class LoginHandler(BaseHandler):
191 self.set_secure_cookie('perguntations_user', str(uid)) 191 self.set_secure_cookie('perguntations_user', str(uid))
192 self.redirect('/') 192 self.redirect('/')
193 else: 193 else:
194 - await asyncio.sleep(3) # to avoid spamming the server... 194 + await asyncio.sleep(3) # delay to avoid spamming the server...
195 self.render('login.html', error=self._error_msg[error]) 195 self.render('login.html', error=self._error_msg[error])
196 196
197 197
perguntations/templates/login.html
@@ -12,7 +12,6 @@ @@ -12,7 +12,6 @@
12 12
13 <!-- Scripts --> 13 <!-- Scripts -->
14 <script src="/static/jquery/jquery.min.js"></script> 14 <script src="/static/jquery/jquery.min.js"></script>
15 - <!-- <script defer src="/static/popper.js/popper.min.js"></script> -->  
16 <script defer src="/static/fontawesome-free/js/all.min.js"></script> 15 <script defer src="/static/fontawesome-free/js/all.min.js"></script>
17 <script defer src="/static/bootstrap/js/bootstrap.bundle.min.js"></script> 16 <script defer src="/static/bootstrap/js/bootstrap.bundle.min.js"></script>
18 17
1 ''' 1 '''
2 Perguntations setup 2 Perguntations setup
3 ''' 3 '''
  4 +
4 from setuptools import setup, find_packages 5 from setuptools import setup, find_packages
5 6
6 from perguntations import (__author__, __license__, 7 from perguntations import (__author__, __license__,