<%! import markdown as md import yaml import random %> <%def name="pretty(text)"> ${md.markdown(str(text), extensions=['markdown.extensions.tables', 'markdown.extensions.fenced_code', 'markdown.extensions.codehilite', 'markdown.extensions.def_list', 'markdown.extensions.sane_lists'])} <% total_points = sum(q['points'] for q in t['questions']) %> % if t['debug']:
                    ${yaml.dump({k:v for k,v in t.items() if k!='questions'})}
                
% endif % if t['practice'] and 'grade' in t:

Resultado

Teve ${'{:.1f}'.format(t['grade'])} valores.

Se quiser, pode corrigir e submeter o teste novamente.
Para terminar escolha a opção 'Sair' no menu.

% endif % for i,q in enumerate(t['questions']):
% if q['type'] == 'information': % elif q['type'] == 'warning': % else:

${q['title']}

Classificar 
${pretty(q['text'])}
% if q['type'] == 'radio': % for opt in q['options']:
% endfor % elif q['type'] == 'checkbox': % for opt in q['options']:
% endfor % elif q['type'] in ('text', 'text_regex'): % elif q['type'] == 'textarea': % endif
% if t['show_hints']: % if 'hint' in q:
${pretty(q['hint'])}
% endif # hint % if 'modal' in q: % endif # modal % endif # show_hints % if t['show_points']:

(Cotação: ${round(q['points'] / total_points * 20.0, 1)} pontos)

% endif % if t['practice'] and 'grade' in q: % if q['grade'] > 0.99:

% elif q['grade'] > 0.49: % else: % endif % endif
% if t['debug'] or t['show_ref']: % endif
% endif
% endfor