${md_to_html(q['text'], q['ref'], q['files'])}
% if q['type'] == 'radio':
% for opt in q['options']:
% if q['answer'] is not None and str(loop.index) == q['answer']:
${md_to_html('
' + opt, q['ref'], q['files'])}
% else:
${md_to_html('
' + opt, q['ref'], q['files'])}
% endif
% endfor
% elif q['type'] == 'checkbox':
% for opt in q['options']:
% if q['answer'] is not None and str(loop.index) in q['answer']:
${md_to_html('
' + opt, q['ref'], q['files'])}
% else:
${md_to_html('
' + opt, q['ref'], q['files'])}
% endif
% endfor
% elif q['type'] in ('text', 'text_regex', 'textarea'):
${q['answer'] if q['answer'] is not None else ''}
% endif
% if t['show_hints']:
% if 'hint' in q:
${md_to_html(q['hint'], q['ref'], q['files'])}
% endif # hint
% endif
% if t['show_points']:
(Cotação: ${round(q['points'] / total_points * 20.0, 1)} pontos)
% endif
% if q['grade'] > 0.99:
${round(q['grade'] * q['points'] / total_points * 20.0, 2)} pontos
${q['comments']}
% elif q['grade'] > 0.49:
${round(q['grade'] * q['points'] / total_points * 20.0, 2)} pontos
${q['comments']}
% else:
${round(q['grade'] * q['points'] / total_points * 20.0, 2)} pontos
${q['comments']}
% endif