From ae36be94af84ec1d4e997ce8d2be8be00b40a92b Mon Sep 17 00:00:00 2001 From: Miguel Barão Date: Tue, 30 Jun 2015 23:37:21 +0100 Subject: [PATCH] - added optional 'lines' to textarea. This option defines the number of lines visible. --- BUGS.md | 4 ++-- MANUAL.md | 2 ++ questions.py | 8 +++++--- templates/test.html | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/BUGS.md b/BUGS.md index e68be98..eb68af7 100644 --- a/BUGS.md +++ b/BUGS.md @@ -9,7 +9,6 @@ Nota final deveria ser arredondada às unidades? Pelo menos na folha de cálculo - 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? - alunos podem entrar duas vezes em simultaneo. impedir, e permitir ao docente fazer kick-out -- desligar submissao com tecla enter no chrome/mac - detectar se falta 'correct' nas perguntas. - check if script to generate questions exist before instantiation. - 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 - warning quando se executa novamente o mesmo teste na consola. ie se ja houver submissoes desse teste. - na cotacao da pergunta indicar o limite inferior, e.g. -0.2 -- 1, 0 -- 0.5 -- textarea com opcao de numero de linhas (consoante o programa a desenvolver podem ser necessarias mais ou menos linhas) - fazer uma calculadora javascript e por no menu. surge como modal - SQLAlchemy em vez da classe database. - 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 # FIXED +- textarea com opcao de numero de linhas (consoante o programa a desenvolver podem ser necessarias mais ou menos linhas) +- desligar submissao com tecla enter no chrome/mac - se database for mal configurada, é criada uma base de dados vazia e rebenta na autenticacao. - 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. - check that files exist in questions generator e correct textarea. add path in test.yaml diff --git a/MANUAL.md b/MANUAL.md index 5102b9c..301eabf 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -287,6 +287,8 @@ The server will try to convert the printed message to a float, a failure will gi type: textarea text: write an expression to add x and y. # optional (default: '') correct: myscript + # optional + lines: 15 ``` The script location is the same as the questions file. diff --git a/questions.py b/questions.py index d3addfe..26ab38c 100644 --- a/questions.py +++ b/questions.py @@ -301,7 +301,7 @@ class QuestionCheckbox(Question): # =========================================================================== class QuestionText(Question): - '''An instance of QuestionCheckbox will always have the keys: + '''An instance of QuestionText will always have the keys: type (str) text (str) correct (list of str) @@ -340,7 +340,7 @@ class QuestionText(Question): # =========================================================================== class QuestionTextRegex(Question): - '''An instance of QuestionCheckbox will always have the keys: + '''An instance of QuestionTextRegex will always have the keys: type (str) text (str) correct (str with regex) @@ -369,11 +369,12 @@ class QuestionTextRegex(Question): # =========================================================================== class QuestionTextArea(Question): - '''An instance of QuestionCheckbox will always have the keys: + '''An instance of QuestionTextArea will always have the keys: type (str) text (str) correct (str with script to run) answer (None or an actual answer) + lines (int) ''' #------------------------------------------------------------------------ @@ -382,6 +383,7 @@ class QuestionTextArea(Question): super().__init__(q) self['text'] = self.get('text', '') self['answer'] = None + self['lines'] = self.get('lines', 8) #------------------------------------------------------------------------ # can return negative values for wrong answers diff --git a/templates/test.html b/templates/test.html index 8e775cf..766cac4 100644 --- a/templates/test.html +++ b/templates/test.html @@ -189,7 +189,7 @@ % elif q['type'] in ('text', 'text_regex'): % elif q['type'] == 'textarea': - + % endif -- libgit2 0.21.2