Commit ae36be94af84ec1d4e997ce8d2be8be00b40a92b

Authored by Miguel Barão
1 parent 58f338e5
Exists in master and in 1 other branch dev

- added optional 'lines' to textarea. This option defines the number of lines visible.

BUGS.md
... ... @@ -9,7 +9,6 @@ Nota final deveria ser arredondada às unidades? Pelo menos na folha de cálculo
9 9  
10 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 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 12 - detectar se falta 'correct' nas perguntas.
14 13 - check if script to generate questions exist before instantiation.
15 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 20  
22 21 - warning quando se executa novamente o mesmo teste na consola. ie se ja houver submissoes desse teste.
23 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 23 - fazer uma calculadora javascript e por no menu. surge como modal
26 24 - SQLAlchemy em vez da classe database.
27 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 36  
39 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 41 - se database for mal configurada, é criada uma base de dados vazia e rebenta na autenticacao.
42 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 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 287 type: textarea
288 288 text: write an expression to add x and y. # optional (default: '')
289 289 correct: myscript
  290 + # optional
  291 + lines: 15
290 292 ```
291 293  
292 294 The script location is the same as the questions file.
... ...
questions.py
... ... @@ -301,7 +301,7 @@ class QuestionCheckbox(Question):
301 301  
302 302 # ===========================================================================
303 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 305 type (str)
306 306 text (str)
307 307 correct (list of str)
... ... @@ -340,7 +340,7 @@ class QuestionText(Question):
340 340  
341 341 # ===========================================================================
342 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 344 type (str)
345 345 text (str)
346 346 correct (str with regex)
... ... @@ -369,11 +369,12 @@ class QuestionTextRegex(Question):
369 369  
370 370 # ===========================================================================
371 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 373 type (str)
374 374 text (str)
375 375 correct (str with script to run)
376 376 answer (None or an actual answer)
  377 + lines (int)
377 378 '''
378 379  
379 380 #------------------------------------------------------------------------
... ... @@ -382,6 +383,7 @@ class QuestionTextArea(Question):
382 383 super().__init__(q)
383 384 self['text'] = self.get('text', '')
384 385 self['answer'] = None
  386 + self['lines'] = self.get('lines', 8)
385 387  
386 388 #------------------------------------------------------------------------
387 389 # can return negative values for wrong answers
... ...
templates/test.html
... ... @@ -189,7 +189,7 @@
189 189 % elif q['type'] in ('text', 'text_regex'):
190 190 <input type="text" name="${q['ref']}" class="form-control" value="${q['answer'] if q['answer'] is not None else ''}">
191 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 193 % endif
194 194 </fieldset>
195 195  
... ...