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,7 +22,7 @@ title: Teste de demonstração (tutorial)
22 22
23 # Duration in minutes. 23 # Duration in minutes.
24 # (0 or undefined means infinite time) 24 # (0 or undefined means infinite time)
25 -duration: 0 25 +duration: 5
26 26
27 # Automatic test submission after the given 'duration' timeout 27 # Automatic test submission after the given 'duration' timeout
28 # (default: false) 28 # (default: false)
demo/questions/generators/generate-question.py
@@ -31,23 +31,26 @@ text: | @@ -31,23 +31,26 @@ text: |
31 31
32 a, b = (int(n) for n in sys.argv[1:]) # argumentos da linha de comando 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 print(f'''--- 38 print(f'''---
39 type: text 39 type: text
40 title: Contas de somar 40 title: Contas de somar
41 text: | 41 text: |
42 - bla bla bla 42 + Calcule o resultado de ${{x}} + {{y}}$.
43 correct: '{{r}}' 43 correct: '{{r}}'
44 solution: | 44 solution: |
45 A solução é {{r}}.''') 45 A solução é {{r}}.''')
46 ``` 46 ```
47 47
48 Este script deve ter permissões para poder ser executado no terminal. 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 ```yaml 55 ```yaml
53 - type: generator 56 - type: generator
@@ -57,8 +60,7 @@ text: | @@ -57,8 +60,7 @@ text: |
57 args: [1, 100] 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,7 +552,7 @@
552 - Imagens inline: não têm título definido e podem ser incluídas no meio de 552 - Imagens inline: não têm título definido e podem ser incluídas no meio de
553 uma linha de texto usando`![alt text](image.jpg)`. 553 uma linha de texto usando`![alt text](image.jpg)`.
554 - Imagens centradas com título: `![alt text](image.jpg "Título da imagem")`. 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 - type: alert 557 - type: alert
558 ref: tut-alert2 558 ref: tut-alert2
@@ -568,7 +568,7 @@ @@ -568,7 +568,7 @@
568 - Imagens inline: não têm título definido e podem ser incluídas no meio de 568 - Imagens inline: não têm título definido e podem ser incluídas no meio de
569 uma linha de texto usando`![alt text](image.jpg)`. 569 uma linha de texto usando`![alt text](image.jpg)`.
570 - Imagens centradas com título: `![alt text](image.jpg "Título da imagem")`. 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 - type: information 574 - type: information
perguntations/templates/question-information.html
1 {% autoescape %} 1 {% autoescape %}
2 2
3 {% if q['type'] == 'information' %} 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 {% elif q['type'] == 'success' %} 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 {% elif q['type'] == 'warning' %} 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 {% else %} 9 {% else %}
10 - <div class="alert alert-danger border-danger" role="alert"> 10 +<div class="alert alert-danger border-danger" role="alert">
11 {% end %} 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 </div> 25 </div>
26 \ No newline at end of file 26 \ No newline at end of file
perguntations/templates/test.html
@@ -89,6 +89,7 @@ @@ -89,6 +89,7 @@
89 89
90 <div class="jumbotron"> 90 <div class="jumbotron">
91 <h1 class="display-5">{{ t['title'] }}</h1> 91 <h1 class="display-5">{{ t['title'] }}</h1>
  92 +
92 <hr> 93 <hr>
93 94
94 <h5> 95 <h5>
@@ -98,11 +99,11 @@ @@ -98,11 +99,11 @@
98 </div> 99 </div>
99 <div class="row"> 100 <div class="row">
100 <label for="duracao" class="col-sm-3">Duração:</label> 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 </div> 103 </div>
103 <div class="row"> 104 <div class="row">
104 <label for="submissao" class="col-sm-3">Submissão:</label> 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 </div> 107 </div>
107 </h5> 108 </h5>
108 </div> 109 </div>
@@ -115,10 +116,10 @@ @@ -115,10 +116,10 @@
115 {% end %} 116 {% end %}
116 117
117 <div class="form-row"> 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 </div> 122 </div>
121 - </div>  
122 </form> 123 </form>
123 <hr> 124 <hr>
124 </div> <!-- container --> 125 </div> <!-- container -->
@@ -191,9 +192,7 @@ @@ -191,9 +192,7 @@
191 var progress = distance/duration*100 + '%' 192 var progress = distance/duration*100 + '%'
192 $('.progress-bar').css('width', progress).attr('aria-valuenow', progress); 193 $('.progress-bar').css('width', progress).attr('aria-valuenow', progress);
193 }, 1000); 194 }, 1000);
194 -  
195 {% end %} 195 {% end %}
196 -  
197 </script> 196 </script>
198 </body> 197 </body>
199 </html> 198 </html>