Commit 1b40ee75b9e98ce77d6e6bbd0398c748a2ccaff2

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

- added debug mode.

Showing 2 changed files with 15 additions and 6 deletions   Show diff stats
templates/test.html
... ... @@ -101,6 +101,7 @@
101 101  
102 102 <%!
103 103 import markdown as md
  104 + import yaml
104 105 %>
105 106 <%def name="pretty(text)">
106 107 ${md.markdown(str(text), extensions=['markdown.extensions.tables',
... ... @@ -209,31 +210,38 @@
209 210 % endif # show_hints
210 211  
211 212 % if t['train_mode'] and 'grade' in q:
212   - % if q['grade'] > 0.9:
  213 + % if q['grade'] > 0.99:
213 214 <div class="alert alert-success" role="alert">
214 215 <span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
215   - ${round(q['grade'] * q['points'] / total_points * 20.0, 1)} valores
  216 + ${round(q['grade'] * q['points'] / total_points * 20.0, 1)} pontos
216 217 </div>
217 218 % elif q['grade'] > 0.5:
218 219 <div class="alert alert-warning" role="alert">
219 220 <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
220   - ${round(q['grade'] * q['points'] / total_points * 20.0, 1)} valores
  221 + ${round(q['grade'] * q['points'] / total_points * 20.0, 1)} pontos
221 222 </div>
222 223 % else:
223 224 <div class="alert alert-danger" role="alert">
224 225 <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
225   - ${round(q['grade'] * q['points'] / total_points * 20.0, 1)} valores
  226 + ${round(q['grade'] * q['points'] / total_points * 20.0, 1)} pontos
226 227 </div>
227 228 % endif
228 229 % endif
229 230  
230 231 % if t['show_points']:
231 232 <p class="text-right">
232   - <small>(${round(q['points'] / total_points * 20.0, 1)} pontos)</small>
  233 + <small>(Cotação: ${round(q['points'] / total_points * 20.0, 1)} pontos)</small>
233 234 <p>
234 235 % endif
235 236  
236 237 </div> <!-- panel-body -->
  238 + % if t['debug']:
  239 + <div class="panel-footer">
  240 + <pre>
  241 + ${yaml.dump(q)}
  242 + </pre>
  243 + </div>
  244 + % endif
237 245 </div> <!-- panel -->
238 246 % endif
239 247 </div> <!-- ui-corner-all custom-corners -->
... ... @@ -252,7 +260,7 @@
252 260 <div class="modal-content">
253 261 <div class="modal-header">
254 262 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
255   - <h4 class="modal-title" id="myModalLabel">Deseja submeter o teste?</h4>
  263 + <h4 class="modal-title">Deseja submeter o teste?</h4>
256 264 </div>
257 265 <div class="modal-body">
258 266 Se submeter, o teste será enviado para classificação e já não poderá voltar atrás.
... ...
test.py
... ... @@ -24,6 +24,7 @@ def read_configuration(filename):
24 24 test['show_hints'] = bool(test.get('show_hints', False))
25 25 test['show_points'] = bool(test.get('show_points', False))
26 26 test['train_mode'] = bool(test.get('train_mode', False))
  27 + test['debug'] = bool(test.get('debug', False))
27 28 test['save_answers'] = bool(test.get('save_answers', True))
28 29 if test['save_answers']:
29 30 if 'answers_dir' not in test:
... ...