Commit ae36be94af84ec1d4e997ce8d2be8be00b40a92b
1 parent
58f338e5
Exists in
master
and in
1 other branch
- added optional 'lines' to textarea. This option defines the number of lines visible.
Showing
4 changed files
with
10 additions
and
6 deletions
Show diff stats
BUGS.md
@@ -9,7 +9,6 @@ Nota final deveria ser arredondada às unidades? Pelo menos na folha de cálculo | @@ -9,7 +9,6 @@ Nota final deveria ser arredondada às unidades? Pelo menos na folha de cálculo | ||
9 | 9 | ||
10 | - alunos vêm nota final arredondada às decimas, mas é apenas um arredondamento visual. Pode acontecer o aluno chumbar, mas ver uma nota positiva (e.g. 9.46 mostra 9.5 e presume que esta aprovado). Mostrar 3 casas? | 10 | - alunos vêm nota final arredondada às decimas, mas é apenas um arredondamento visual. Pode acontecer o aluno chumbar, mas ver uma nota positiva (e.g. 9.46 mostra 9.5 e presume que esta aprovado). Mostrar 3 casas? |
11 | - alunos podem entrar duas vezes em simultaneo. impedir, e permitir ao docente fazer kick-out | 11 | - alunos podem entrar duas vezes em simultaneo. impedir, e permitir ao docente fazer kick-out |
12 | -- desligar submissao com tecla enter no chrome/mac | ||
13 | - detectar se falta 'correct' nas perguntas. | 12 | - detectar se falta 'correct' nas perguntas. |
14 | - check if script to generate questions exist before instantiation. | 13 | - check if script to generate questions exist before instantiation. |
15 | - paths manipulation in strings is unix only ('/something'). use os.path to create paths. | 14 | - paths manipulation in strings is unix only ('/something'). use os.path to create paths. |
@@ -21,7 +20,6 @@ Nota final deveria ser arredondada às unidades? Pelo menos na folha de cálculo | @@ -21,7 +20,6 @@ Nota final deveria ser arredondada às unidades? Pelo menos na folha de cálculo | ||
21 | 20 | ||
22 | - warning quando se executa novamente o mesmo teste na consola. ie se ja houver submissoes desse teste. | 21 | - warning quando se executa novamente o mesmo teste na consola. ie se ja houver submissoes desse teste. |
23 | - na cotacao da pergunta indicar o limite inferior, e.g. -0.2 -- 1, 0 -- 0.5 | 22 | - na cotacao da pergunta indicar o limite inferior, e.g. -0.2 -- 1, 0 -- 0.5 |
24 | -- textarea com opcao de numero de linhas (consoante o programa a desenvolver podem ser necessarias mais ou menos linhas) | ||
25 | - fazer uma calculadora javascript e por no menu. surge como modal | 23 | - fazer uma calculadora javascript e por no menu. surge como modal |
26 | - SQLAlchemy em vez da classe database. | 24 | - SQLAlchemy em vez da classe database. |
27 | - Criar botão para o docente fazer enable/disable do aluno explicitamente (exames presenciais). | 25 | - Criar botão para o docente fazer enable/disable do aluno explicitamente (exames presenciais). |
@@ -38,6 +36,8 @@ Nota final deveria ser arredondada às unidades? Pelo menos na folha de cálculo | @@ -38,6 +36,8 @@ Nota final deveria ser arredondada às unidades? Pelo menos na folha de cálculo | ||
38 | 36 | ||
39 | # FIXED | 37 | # FIXED |
40 | 38 | ||
39 | +- textarea com opcao de numero de linhas (consoante o programa a desenvolver podem ser necessarias mais ou menos linhas) | ||
40 | +- desligar submissao com tecla enter no chrome/mac | ||
41 | - se database for mal configurada, é criada uma base de dados vazia e rebenta na autenticacao. | 41 | - se database for mal configurada, é criada uma base de dados vazia e rebenta na autenticacao. |
42 | - questions type script, necessário dar um caminho exacto relativamete ao directorio do server em vez da pergunta. deveria ser possivel mover as perguntas de directorio sem rebentar os caminhos. | 42 | - questions type script, necessário dar um caminho exacto relativamete ao directorio do server em vez da pergunta. deveria ser possivel mover as perguntas de directorio sem rebentar os caminhos. |
43 | - check that files exist in questions generator e correct textarea. add path in test.yaml | 43 | - check that files exist in questions generator e correct textarea. add path in test.yaml |
MANUAL.md
@@ -287,6 +287,8 @@ The server will try to convert the printed message to a float, a failure will gi | @@ -287,6 +287,8 @@ The server will try to convert the printed message to a float, a failure will gi | ||
287 | type: textarea | 287 | type: textarea |
288 | text: write an expression to add x and y. # optional (default: '') | 288 | text: write an expression to add x and y. # optional (default: '') |
289 | correct: myscript | 289 | correct: myscript |
290 | + # optional | ||
291 | + lines: 15 | ||
290 | ``` | 292 | ``` |
291 | 293 | ||
292 | The script location is the same as the questions file. | 294 | The script location is the same as the questions file. |
questions.py
@@ -301,7 +301,7 @@ class QuestionCheckbox(Question): | @@ -301,7 +301,7 @@ class QuestionCheckbox(Question): | ||
301 | 301 | ||
302 | # =========================================================================== | 302 | # =========================================================================== |
303 | class QuestionText(Question): | 303 | class QuestionText(Question): |
304 | - '''An instance of QuestionCheckbox will always have the keys: | 304 | + '''An instance of QuestionText will always have the keys: |
305 | type (str) | 305 | type (str) |
306 | text (str) | 306 | text (str) |
307 | correct (list of str) | 307 | correct (list of str) |
@@ -340,7 +340,7 @@ class QuestionText(Question): | @@ -340,7 +340,7 @@ class QuestionText(Question): | ||
340 | 340 | ||
341 | # =========================================================================== | 341 | # =========================================================================== |
342 | class QuestionTextRegex(Question): | 342 | class QuestionTextRegex(Question): |
343 | - '''An instance of QuestionCheckbox will always have the keys: | 343 | + '''An instance of QuestionTextRegex will always have the keys: |
344 | type (str) | 344 | type (str) |
345 | text (str) | 345 | text (str) |
346 | correct (str with regex) | 346 | correct (str with regex) |
@@ -369,11 +369,12 @@ class QuestionTextRegex(Question): | @@ -369,11 +369,12 @@ class QuestionTextRegex(Question): | ||
369 | 369 | ||
370 | # =========================================================================== | 370 | # =========================================================================== |
371 | class QuestionTextArea(Question): | 371 | class QuestionTextArea(Question): |
372 | - '''An instance of QuestionCheckbox will always have the keys: | 372 | + '''An instance of QuestionTextArea will always have the keys: |
373 | type (str) | 373 | type (str) |
374 | text (str) | 374 | text (str) |
375 | correct (str with script to run) | 375 | correct (str with script to run) |
376 | answer (None or an actual answer) | 376 | answer (None or an actual answer) |
377 | + lines (int) | ||
377 | ''' | 378 | ''' |
378 | 379 | ||
379 | #------------------------------------------------------------------------ | 380 | #------------------------------------------------------------------------ |
@@ -382,6 +383,7 @@ class QuestionTextArea(Question): | @@ -382,6 +383,7 @@ class QuestionTextArea(Question): | ||
382 | super().__init__(q) | 383 | super().__init__(q) |
383 | self['text'] = self.get('text', '') | 384 | self['text'] = self.get('text', '') |
384 | self['answer'] = None | 385 | self['answer'] = None |
386 | + self['lines'] = self.get('lines', 8) | ||
385 | 387 | ||
386 | #------------------------------------------------------------------------ | 388 | #------------------------------------------------------------------------ |
387 | # can return negative values for wrong answers | 389 | # can return negative values for wrong answers |
templates/test.html
@@ -189,7 +189,7 @@ | @@ -189,7 +189,7 @@ | ||
189 | % elif q['type'] in ('text', 'text_regex'): | 189 | % elif q['type'] in ('text', 'text_regex'): |
190 | <input type="text" name="${q['ref']}" class="form-control" value="${q['answer'] if q['answer'] is not None else ''}"> | 190 | <input type="text" name="${q['ref']}" class="form-control" value="${q['answer'] if q['answer'] is not None else ''}"> |
191 | % elif q['type'] == 'textarea': | 191 | % elif q['type'] == 'textarea': |
192 | - <textarea class="form-control" rows="8" name="${q['ref']}">${q['answer'] if q['answer'] is not None else ''}</textarea> | 192 | + <textarea class="form-control" rows="${q['lines']}" name="${q['ref']}">${q['answer'] if q['answer'] is not None else ''}</textarea> |
193 | % endif | 193 | % endif |
194 | </fieldset> | 194 | </fieldset> |
195 | 195 |