Commit 44730b140243837b89b97ae5fd4a2db4f5f35b8a

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

minor changes

demo/demo.yaml
... ... @@ -22,7 +22,7 @@ title: Teste de demonstração (tutorial)
22 22  
23 23 # Duration in minutes.
24 24 # (0 or undefined means infinite time)
25   -duration: 0
  25 +duration: 5
26 26  
27 27 # Automatic test submission after the given 'duration' timeout
28 28 # (default: false)
... ...
demo/questions/generators/generate-question.py
... ... @@ -31,23 +31,26 @@ text: |
31 31  
32 32 a, b = (int(n) for n in sys.argv[1:]) # argumentos da linha de comando
33 33  
34   - x = randint(a, b)
35   - y = randint(a, b)
36   - r = x + y
  34 + x = randint(a, b) # número inteiro no intervalo a..b
  35 + y = randint(a, b) # número inteiro no intervalo a..b
  36 + r = x + y # calcula resultado correcto
37 37  
38 38 print(f'''---
39 39 type: text
40 40 title: Contas de somar
41 41 text: |
42   - bla bla bla
  42 + Calcule o resultado de ${{x}} + {{y}}$.
43 43 correct: '{{r}}'
44 44 solution: |
45 45 A solução é {{r}}.''')
46 46 ```
47 47  
48 48 Este script deve ter permissões para poder ser executado no terminal.
  49 + Podemos testar o programa no terminal `./gen-somar.py 1 50` e verificar que
  50 + o output é uma pergunta válida em formato `yaml`. Agora é necessário indicar
  51 + que este script deve ser usado para gerar uma pergunta.
49 52  
50   - Para indicar que uma pergunta é gerada externamente, esta é declarada com
  53 + Uma pergunta gerada por um programa externo é declarada com
51 54  
52 55 ```yaml
53 56 - type: generator
... ... @@ -57,8 +60,7 @@ text: |
57 60 args: [1, 100]
58 61 ```
59 62  
60   - Opcionalmente, o programa pode receber uma lista de argumentos declarados em
61   - `args`.
  63 + O programa pode receber uma lista de argumentos declarados em `args`.
62 64  
63 65 ---
64 66  
... ...
demo/questions/questions-tutorial.yaml
... ... @@ -552,7 +552,7 @@
552 552 - Imagens inline: não têm título definido e podem ser incluídas no meio de
553 553 uma linha de texto usando`![alt text](image.jpg)`.
554 554 - Imagens centradas com título: `![alt text](image.jpg "Título da imagem")`.
555   - O título aprece por baixo da imagem. O título pode ser uma string vazia.
  555 + O título é colocado por baixo da imagem. Pode ser uma string vazia.
556 556  
557 557 - type: alert
558 558 ref: tut-alert2
... ... @@ -568,7 +568,7 @@
568 568 - Imagens inline: não têm título definido e podem ser incluídas no meio de
569 569 uma linha de texto usando`![alt text](image.jpg)`.
570 570 - Imagens centradas com título: `![alt text](image.jpg "Título da imagem")`.
571   - O título aprece por baixo da imagem. O título pode ser uma string vazia.
  571 + O título é colocado por baixo da imagem. Pode ser uma string vazia.
572 572  
573 573 # ----------------------------------------------------------------------------
574 574 - type: information
... ...
perguntations/templates/question-information.html
1 1 {% autoescape %}
2 2  
3 3 {% if q['type'] == 'information' %}
4   - <div class="alert alert-info border-info" role="alert">
  4 +<div class="alert alert-info border-info" role="alert">
5 5 {% elif q['type'] == 'success' %}
6   - <div class="alert alert-success border-success" role="alert">
  6 +<div class="alert alert-success border-success" role="alert">
7 7 {% elif q['type'] == 'warning' %}
8   - <div class="alert alert-warning border-warning" role="alert">
  8 +<div class="alert alert-warning border-warning" role="alert">
9 9 {% else %}
10   - <div class="alert alert-danger border-danger" role="alert">
  10 +<div class="alert alert-danger border-danger" role="alert">
11 11 {% end %}
12   - <h3>
13   - {{ q['title'] }}
14   - </h3>
  12 + <h3>
  13 + {{ q['title'] }}
  14 + </h3>
15 15  
16   - <div id="text">
17   - {{ md(q['text']) }}
18   - </div>
  16 + <div id="text">
  17 + {{ md(q['text']) }}
  18 + </div>
19 19  
20   - {% if show_ref %}
21   - <hr>
22   - file: <code>{{ q['path'] }}/{{ q['filename'] }}</code><br>
23   - ref: <code>{{ q['ref'] }}</code>
24   - {% end %}
  20 + {% if show_ref %}
  21 + <hr>
  22 + file: <code>{{ q['path'] }}/{{ q['filename'] }}</code><br>
  23 + ref: <code>{{ q['ref'] }}</code>
  24 + {% end %}
25 25 </div>
26 26 \ No newline at end of file
... ...
perguntations/templates/test.html
... ... @@ -89,6 +89,7 @@
89 89  
90 90 <div class="jumbotron">
91 91 <h1 class="display-5">{{ t['title'] }}</h1>
  92 +
92 93 <hr>
93 94  
94 95 <h5>
... ... @@ -98,11 +99,11 @@
98 99 </div>
99 100 <div class="row">
100 101 <label for="duracao" class="col-sm-3">Duração:</label>
101   - <div class="col-sm-9" id="duracao">{{ str(t['duration'])+' minutos' if t['duration'] > 0 else 'sem limite' }}</div>
  102 + <div class="col-sm-9" id="duracao">{{ str(t['duration'])+' minutos' if t['duration'] > 0 else 'sem limite de tempo' }}</div>
102 103 </div>
103 104 <div class="row">
104 105 <label for="submissao" class="col-sm-3">Submissão:</label>
105   - <div class="col-sm-9" id="submissao">{{ 'automática' if t['autosubmit'] else 'manual' }}</div>
  106 + <div class="col-sm-9" id="submissao">{{ 'automática no fim do tempo' if t['autosubmit'] else 'manual' }}</div>
106 107 </div>
107 108 </h5>
108 109 </div>
... ... @@ -115,10 +116,10 @@
115 116 {% end %}
116 117  
117 118 <div class="form-row">
118   - <div class="col-12">
119   - <button type="button" class="btn btn-success btn-lg btn-block" data-toggle="modal" data-target="#confirmar" id="form-button-submit">Submeter teste</button>
  119 + <div class="col-12">
  120 + <button type="button" class="btn btn-success btn-lg btn-block" data-toggle="modal" data-target="#confirmar" id="form-button-submit">Submeter teste</button>
  121 + </div>
120 122 </div>
121   - </div>
122 123 </form>
123 124 <hr>
124 125 </div> <!-- container -->
... ... @@ -191,9 +192,7 @@
191 192 var progress = distance/duration*100 + '%'
192 193 $('.progress-bar').css('width', progress).attr('aria-valuenow', progress);
193 194 }, 1000);
194   -
195 195 {% end %}
196   -
197 196 </script>
198 197 </body>
199 198 </html>
... ...