diff --git a/BUGS.md b/BUGS.md index 72e7db3..201e7c7 100644 --- a/BUGS.md +++ b/BUGS.md @@ -1,7 +1,5 @@ # BUGS -- first login é INFO e não WARNING -- se save_answers nao existir, da warning que nao serao gravados, mas sao sempre gravados! pagina de administracao diz --not being saved-- - se submeter um teste so com information, da divisao por zero. - se pergunta for 'type: info' rebenta - se um teste tiver a mesma pergunta (ref igual) varias vezes, rebenta na correcçao. As respostas são agregadas numa lista para cada ref. Ex: @@ -30,6 +28,8 @@ possivelmente as referencias das perguntas deveriam ser o "testeRef:numPergunta" # FIXED +- se save_answers nao existir, da warning que nao serao gravados, mas sao sempre gravados! pagina de administracao diz --not being saved-- +- first login é INFO e não WARNING - /review não mostra imagens porque precisa que teste esteja a decorrer... - visualizar um teste ja realizado na página de administração - Depois da correcção, mostra testes realizados que não foram realizados pelo próprio diff --git a/app.py b/app.py index 0de331f..8d65fdc 100644 --- a/app.py +++ b/app.py @@ -82,7 +82,7 @@ class App(object): hashed_pw = bcrypt.hashpw(try_pw.encode('utf-8'), bcrypt.gensalt()) student.password = hashed_pw s.commit() - logger.warning('Student {}: first login, password updated.'.format(uid)) + logger.info('Student {}: first login, password updated.'.format(uid)) elif bcrypt.hashpw(try_pw.encode('utf-8'), student.password) != student.password: # wrong password diff --git a/static/js/admin.js b/static/js/admin.js index 15429fd..14bb1a2 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -145,12 +145,7 @@ $(document).ready(function() { $("#ref").html(data['test']['ref']); $("#filename").html(data['test']['filename']); $("#database").html(data['test']['database']); - if (data['test']['save_answers']) { - $("#answers_dir").html(data['test']['answers_dir']); - } - else { - $("#answers_dir").html('--- not being saved ---'); - } + $("#answers_dir").html(data['test']['answers_dir']); // fill online and student tables populateOnlineTable(data["students"]); diff --git a/test.py b/test.py index 00664c3..417451b 100644 --- a/test.py +++ b/test.py @@ -75,10 +75,8 @@ class TestFactory(dict): if 'ref' not in self: logger.warning('Missing "ref". Will use current date/time.') - if 'answers_dir' not in self and self.get('save_answers', False): + if 'answers_dir' not in self: logger.warning('Missing "answers_dir". Will use current directory!') - if 'save_answers' not in self: - logger.warning('Missing "save_answers". Answers will NOT be saved!') if 'questions_dir' not in self: logger.warning('Missing "questions_dir". Using {}'.format(path.abspath(path.curdir))) if 'files' not in self: @@ -92,7 +90,6 @@ class TestFactory(dict): self.setdefault('debug', False) self.setdefault('show_ref', False) self.setdefault('questions_dir', path.curdir) - self.setdefault('save_answers', False) self.setdefault('answers_dir', path.curdir) self['database'] = path.abspath(path.expanduser(self['database'])) self['questions_dir'] = path.abspath(path.expanduser(self['questions_dir'])) @@ -134,8 +131,6 @@ class TestFactory(dict): # normalize questions to a list of dictionaries # ----------------------------------------------------------------------- def normalize_questions(self): - - # print(self['questions']) for i, q in enumerate(self['questions']): # normalize question to a dict and ref to a list of references if isinstance(q, str): @@ -144,7 +139,6 @@ class TestFactory(dict): q['ref'] = [q['ref']] self['questions'][i] = q - # print(self['questions']) # ----------------------------------------------------------------------- # Given a dictionary with a student id {'name':'john', 'number': 123} @@ -172,11 +166,9 @@ class TestFactory(dict): 'title': self['title'], # title of the test 'student': student, # student id 'questions': test, # list of questions - 'save_answers': self['save_answers'], 'answers_dir': self['answers_dir'], # FIXME which ones are required? - # 'practice': self['practice'], # FIXME remove? 'show_hints': self['show_hints'], 'show_points': self['show_points'], 'show_ref': self['show_ref'], -- libgit2 0.21.2