Commit e530d705a77d6a82493eae354008462cf078912a
1 parent
46d7b70a
Exists in
master
and in
1 other branch
- First login log moved from WARNING to INFO.
- Answers are always saved. Removed 'save_answers' option.
Showing
4 changed files
with
5 additions
and
18 deletions
Show diff stats
BUGS.md
1 | 1 | ||
2 | # BUGS | 2 | # BUGS |
3 | -- first login é INFO e não WARNING | ||
4 | -- se save_answers nao existir, da warning que nao serao gravados, mas sao sempre gravados! pagina de administracao diz --not being saved-- | ||
5 | - se submeter um teste so com information, da divisao por zero. | 3 | - se submeter um teste so com information, da divisao por zero. |
6 | - se pergunta for 'type: info' rebenta | 4 | - se pergunta for 'type: info' rebenta |
7 | - 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: | 5 | - 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" | @@ -30,6 +28,8 @@ possivelmente as referencias das perguntas deveriam ser o "testeRef:numPergunta" | ||
30 | 28 | ||
31 | # FIXED | 29 | # FIXED |
32 | 30 | ||
31 | +- se save_answers nao existir, da warning que nao serao gravados, mas sao sempre gravados! pagina de administracao diz --not being saved-- | ||
32 | +- first login é INFO e não WARNING | ||
33 | - /review não mostra imagens porque precisa que teste esteja a decorrer... | 33 | - /review não mostra imagens porque precisa que teste esteja a decorrer... |
34 | - visualizar um teste ja realizado na página de administração | 34 | - visualizar um teste ja realizado na página de administração |
35 | - Depois da correcção, mostra testes realizados que não foram realizados pelo próprio | 35 | - Depois da correcção, mostra testes realizados que não foram realizados pelo próprio |
app.py
@@ -82,7 +82,7 @@ class App(object): | @@ -82,7 +82,7 @@ class App(object): | ||
82 | hashed_pw = bcrypt.hashpw(try_pw.encode('utf-8'), bcrypt.gensalt()) | 82 | hashed_pw = bcrypt.hashpw(try_pw.encode('utf-8'), bcrypt.gensalt()) |
83 | student.password = hashed_pw | 83 | student.password = hashed_pw |
84 | s.commit() | 84 | s.commit() |
85 | - logger.warning('Student {}: first login, password updated.'.format(uid)) | 85 | + logger.info('Student {}: first login, password updated.'.format(uid)) |
86 | 86 | ||
87 | elif bcrypt.hashpw(try_pw.encode('utf-8'), student.password) != student.password: | 87 | elif bcrypt.hashpw(try_pw.encode('utf-8'), student.password) != student.password: |
88 | # wrong password | 88 | # wrong password |
static/js/admin.js
@@ -145,12 +145,7 @@ $(document).ready(function() { | @@ -145,12 +145,7 @@ $(document).ready(function() { | ||
145 | $("#ref").html(data['test']['ref']); | 145 | $("#ref").html(data['test']['ref']); |
146 | $("#filename").html(data['test']['filename']); | 146 | $("#filename").html(data['test']['filename']); |
147 | $("#database").html(data['test']['database']); | 147 | $("#database").html(data['test']['database']); |
148 | - if (data['test']['save_answers']) { | ||
149 | - $("#answers_dir").html(data['test']['answers_dir']); | ||
150 | - } | ||
151 | - else { | ||
152 | - $("#answers_dir").html('--- not being saved ---'); | ||
153 | - } | 148 | + $("#answers_dir").html(data['test']['answers_dir']); |
154 | 149 | ||
155 | // fill online and student tables | 150 | // fill online and student tables |
156 | populateOnlineTable(data["students"]); | 151 | populateOnlineTable(data["students"]); |
test.py
@@ -75,10 +75,8 @@ class TestFactory(dict): | @@ -75,10 +75,8 @@ class TestFactory(dict): | ||
75 | 75 | ||
76 | if 'ref' not in self: | 76 | if 'ref' not in self: |
77 | logger.warning('Missing "ref". Will use current date/time.') | 77 | logger.warning('Missing "ref". Will use current date/time.') |
78 | - if 'answers_dir' not in self and self.get('save_answers', False): | 78 | + if 'answers_dir' not in self: |
79 | logger.warning('Missing "answers_dir". Will use current directory!') | 79 | logger.warning('Missing "answers_dir". Will use current directory!') |
80 | - if 'save_answers' not in self: | ||
81 | - logger.warning('Missing "save_answers". Answers will NOT be saved!') | ||
82 | if 'questions_dir' not in self: | 80 | if 'questions_dir' not in self: |
83 | logger.warning('Missing "questions_dir". Using {}'.format(path.abspath(path.curdir))) | 81 | logger.warning('Missing "questions_dir". Using {}'.format(path.abspath(path.curdir))) |
84 | if 'files' not in self: | 82 | if 'files' not in self: |
@@ -92,7 +90,6 @@ class TestFactory(dict): | @@ -92,7 +90,6 @@ class TestFactory(dict): | ||
92 | self.setdefault('debug', False) | 90 | self.setdefault('debug', False) |
93 | self.setdefault('show_ref', False) | 91 | self.setdefault('show_ref', False) |
94 | self.setdefault('questions_dir', path.curdir) | 92 | self.setdefault('questions_dir', path.curdir) |
95 | - self.setdefault('save_answers', False) | ||
96 | self.setdefault('answers_dir', path.curdir) | 93 | self.setdefault('answers_dir', path.curdir) |
97 | self['database'] = path.abspath(path.expanduser(self['database'])) | 94 | self['database'] = path.abspath(path.expanduser(self['database'])) |
98 | self['questions_dir'] = path.abspath(path.expanduser(self['questions_dir'])) | 95 | self['questions_dir'] = path.abspath(path.expanduser(self['questions_dir'])) |
@@ -134,8 +131,6 @@ class TestFactory(dict): | @@ -134,8 +131,6 @@ class TestFactory(dict): | ||
134 | # normalize questions to a list of dictionaries | 131 | # normalize questions to a list of dictionaries |
135 | # ----------------------------------------------------------------------- | 132 | # ----------------------------------------------------------------------- |
136 | def normalize_questions(self): | 133 | def normalize_questions(self): |
137 | - | ||
138 | - # print(self['questions']) | ||
139 | for i, q in enumerate(self['questions']): | 134 | for i, q in enumerate(self['questions']): |
140 | # normalize question to a dict and ref to a list of references | 135 | # normalize question to a dict and ref to a list of references |
141 | if isinstance(q, str): | 136 | if isinstance(q, str): |
@@ -144,7 +139,6 @@ class TestFactory(dict): | @@ -144,7 +139,6 @@ class TestFactory(dict): | ||
144 | q['ref'] = [q['ref']] | 139 | q['ref'] = [q['ref']] |
145 | 140 | ||
146 | self['questions'][i] = q | 141 | self['questions'][i] = q |
147 | - # print(self['questions']) | ||
148 | 142 | ||
149 | # ----------------------------------------------------------------------- | 143 | # ----------------------------------------------------------------------- |
150 | # Given a dictionary with a student id {'name':'john', 'number': 123} | 144 | # Given a dictionary with a student id {'name':'john', 'number': 123} |
@@ -172,11 +166,9 @@ class TestFactory(dict): | @@ -172,11 +166,9 @@ class TestFactory(dict): | ||
172 | 'title': self['title'], # title of the test | 166 | 'title': self['title'], # title of the test |
173 | 'student': student, # student id | 167 | 'student': student, # student id |
174 | 'questions': test, # list of questions | 168 | 'questions': test, # list of questions |
175 | - 'save_answers': self['save_answers'], | ||
176 | 'answers_dir': self['answers_dir'], | 169 | 'answers_dir': self['answers_dir'], |
177 | 170 | ||
178 | # FIXME which ones are required? | 171 | # FIXME which ones are required? |
179 | - # 'practice': self['practice'], # FIXME remove? | ||
180 | 'show_hints': self['show_hints'], | 172 | 'show_hints': self['show_hints'], |
181 | 'show_points': self['show_points'], | 173 | 'show_points': self['show_points'], |
182 | 'show_ref': self['show_ref'], | 174 | 'show_ref': self['show_ref'], |