Commit 53e9b6550810c44d21325e36f2e714318055de12
1 parent
dbbd7c2a
Exists in
master
and in
1 other branch
- incorporate fixes from test.py (already in master)
- update BUGS.md
Showing
4 changed files
with
21 additions
and
13 deletions
Show diff stats
.gitignore
@@ -9,4 +9,7 @@ static/lib | @@ -9,4 +9,7 @@ static/lib | ||
9 | /*.eggnode_modules | 9 | /*.eggnode_modules |
10 | 10 | ||
11 | # ignore javascript libraries installed with npm | 11 | # ignore javascript libraries installed with npm |
12 | -node_modules/ | ||
13 | \ No newline at end of file | 12 | \ No newline at end of file |
13 | +node_modules/ | ||
14 | + | ||
15 | +# ignore documentation until it is actually written | ||
16 | +doc/ | ||
14 | \ No newline at end of file | 17 | \ No newline at end of file |
BUGS.md
1 | 1 | ||
2 | # BUGS | 2 | # BUGS |
3 | 3 | ||
4 | -- quando se clica no texto de uma opcao, salta para outro lado na pagina. | 4 | +- codigo `hello world` nao esta a preservar o whitespace. O renderer de markdown gera a tag <code> que não preserva whitespace. Necessario adicionar <pre>. |
5 | +- teste nao esta a mostrar imagens. | ||
6 | +- se houver erros a abrir ficheiros .yaml de perguntas, depois dos testes diz "No errors found". | ||
7 | +- dizer quanto desconta em cada pergunta de escolha multipla | ||
5 | - ordenacao das notas em /admin nao é numerica, é ascii... | 8 | - ordenacao das notas em /admin nao é numerica, é ascii... |
6 | - mensagems de erro do assembler aparecem na mesma linha na correcao e nao fazerm rendering do `$t`, ver se servidor faz parse do markdown dessas mensagens. | 9 | - mensagems de erro do assembler aparecem na mesma linha na correcao e nao fazerm rendering do `$t`, ver se servidor faz parse do markdown dessas mensagens. |
7 | - impedir os eventos copy/paste. alunos usam isso para trazer codigo ja feito nos computadores. Obrigar a fazer reset? fazer um copy automaticamente? | 10 | - impedir os eventos copy/paste. alunos usam isso para trazer codigo ja feito nos computadores. Obrigar a fazer reset? fazer um copy automaticamente? |
@@ -12,9 +15,11 @@ ou usar push (websockets?) | @@ -12,9 +15,11 @@ ou usar push (websockets?) | ||
12 | - lidar com eventos unfocus. | 15 | - lidar com eventos unfocus. |
13 | - servidor nao esta a lidar com eventos scroll/resize. ignorar? | 16 | - servidor nao esta a lidar com eventos scroll/resize. ignorar? |
14 | - Test.reset_answers() unused. | 17 | - Test.reset_answers() unused. |
18 | +- mudar ref do test para test_id (ref já é usado nas perguntas) | ||
15 | 19 | ||
16 | # TODO | 20 | # TODO |
17 | 21 | ||
22 | +- nao esta a usar points das perguntas | ||
18 | - test: mostrar duração do teste com progressbar no navbar. | 23 | - test: mostrar duração do teste com progressbar no navbar. |
19 | - submissao fazer um post ajax? | 24 | - submissao fazer um post ajax? |
20 | - adicionar opcao para eliminar um teste em curso. | 25 | - adicionar opcao para eliminar um teste em curso. |
@@ -54,6 +59,7 @@ ou usar push (websockets?) | @@ -54,6 +59,7 @@ ou usar push (websockets?) | ||
54 | 59 | ||
55 | # FIXED | 60 | # FIXED |
56 | 61 | ||
62 | +- quando se clica no texto de uma opcao, salta para outro lado na pagina. | ||
57 | - suportar cotacao to teste diferente de 20 (e.g. para juntar perguntas em papel). opcao "points: 18" que normaliza total para 18 em vez de 20. | 63 | - suportar cotacao to teste diferente de 20 (e.g. para juntar perguntas em papel). opcao "points: 18" que normaliza total para 18 em vez de 20. |
58 | - fazer package para instalar perguntations com pip. | 64 | - fazer package para instalar perguntations com pip. |
59 | - pymips: nao pode executar syscalls do spim. | 65 | - pymips: nao pode executar syscalls do spim. |
perguntations/__init__.py
@@ -32,7 +32,7 @@ proof of submission and for review. | @@ -32,7 +32,7 @@ proof of submission and for review. | ||
32 | ''' | 32 | ''' |
33 | 33 | ||
34 | APP_NAME = 'perguntations' | 34 | APP_NAME = 'perguntations' |
35 | -APP_VERSION = '2019.02.dev1' | 35 | +APP_VERSION = '2019.06.dev1' |
36 | APP_DESCRIPTION = __doc__ | 36 | APP_DESCRIPTION = __doc__ |
37 | 37 | ||
38 | __author__ = 'Miguel Barão' | 38 | __author__ = 'Miguel Barão' |
perguntations/test.py
@@ -133,13 +133,11 @@ class TestFactory(dict): | @@ -133,13 +133,11 @@ class TestFactory(dict): | ||
133 | 133 | ||
134 | testfile = path.join(path.expanduser(self['answers_dir']), 'REMOVE-ME') | 134 | testfile = path.join(path.expanduser(self['answers_dir']), 'REMOVE-ME') |
135 | try: # check if answers_dir is a writable directory | 135 | try: # check if answers_dir is a writable directory |
136 | - f = open(testfile, 'w') | 136 | + with open(testfile, 'w') as f: |
137 | + f.write('You can safely remove this file.') | ||
137 | except OSError: | 138 | except OSError: |
138 | logger.critical(f'Can\'t write answers to "{self["answers_dir"]}"') | 139 | logger.critical(f'Can\'t write answers to "{self["answers_dir"]}"') |
139 | raise TestFactoryException() | 140 | raise TestFactoryException() |
140 | - else: | ||
141 | - with f: | ||
142 | - f.write('You can safely remove this file.') | ||
143 | 141 | ||
144 | # --- ref | 142 | # --- ref |
145 | if 'ref' not in self: | 143 | if 'ref' not in self: |
@@ -176,8 +174,8 @@ class TestFactory(dict): | @@ -176,8 +174,8 @@ class TestFactory(dict): | ||
176 | 174 | ||
177 | for i, q in enumerate(self['questions']): | 175 | for i, q in enumerate(self['questions']): |
178 | # normalize question to a dict and ref to a list of references | 176 | # normalize question to a dict and ref to a list of references |
179 | - if isinstance(q, str): | ||
180 | - q = {'ref': [q]} | 177 | + if isinstance(q, str): # e.g., - some_ref |
178 | + q = {'ref': [q]} # becomes - ref: [some_ref] | ||
181 | elif isinstance(q, dict) and isinstance(q['ref'], str): | 179 | elif isinstance(q, dict) and isinstance(q['ref'], str): |
182 | q['ref'] = [q['ref']] | 180 | q['ref'] = [q['ref']] |
183 | 181 | ||
@@ -191,8 +189,9 @@ class TestFactory(dict): | @@ -191,8 +189,9 @@ class TestFactory(dict): | ||
191 | test = [] | 189 | test = [] |
192 | # total_points = 0.0 | 190 | # total_points = 0.0 |
193 | 191 | ||
194 | - n = 1 | ||
195 | - nerr = 0 | 192 | + n = 1 # track question number |
193 | + nerr = 0 # count errors generating questions | ||
194 | + | ||
196 | for qq in self['questions']: | 195 | for qq in self['questions']: |
197 | # choose one question variant | 196 | # choose one question variant |
198 | qref = random.choice(qq['ref']) | 197 | qref = random.choice(qq['ref']) |
@@ -207,9 +206,9 @@ class TestFactory(dict): | @@ -207,9 +206,9 @@ class TestFactory(dict): | ||
207 | 206 | ||
208 | # some defaults | 207 | # some defaults |
209 | if q['type'] in ('information', 'success', 'warning', 'alert'): | 208 | if q['type'] in ('information', 'success', 'warning', 'alert'): |
210 | - q.setdefault('points', 0.0) | 209 | + q['points'] = qq.get('points', 0.0) |
211 | else: | 210 | else: |
212 | - q.setdefault('points', 1.0) | 211 | + q['points'] = qq.get('points', 1.0) |
213 | q['number'] = n # counter for non informative panels | 212 | q['number'] = n # counter for non informative panels |
214 | n += 1 | 213 | n += 1 |
215 | 214 |