Intro-to-Jinja-tpl-v2/templates/results.html

17 lines
382 B
HTML

{# templates/results.html #}
{% extends "base.html" %}
{% block content %}
<h1>{{ test_name }} {{ title }}: </h1>
<ul>
{% for student in students|sort(attribute="name") %}
<li>
{% if student.score > 80 %} :-) {% else %} :-( {% endif %}
<em>{{ student.name }}:</em> {{ student.score }}/{{ max_score }}
</li>
{% endfor %}
</ul>
{% endblock content %}