{% set need_js = True %} {% set title = g.topic.title + ' – ' + g.course.name %} {% if show_for_user %} {% set title = show_for_user + ' – ' + title %} {% endif %} {% extends "base.html" %} {% import "parts/navigation.html" as nav %} {% block body %} {% if g.is_admin %} {% endif %}

{{ g.course.name }}

{{ nav.course_menu('topic') }}

{{ g.topic.title }} {% if not g.topic.public %} [private]{% endif %} {% if show_for_user %} – {{ show_for_user }} {% endif %} {% if student_uid == -1 %} – posts for all students {% endif %}

{% if g.topic.deadline != None %}

Deadline: {{ g.topic.deadline|reltimeformat }} {% endif %} {% if g.topic.max_points != None %}

Max points: {{ g.topic.max_points }} {% endif %} {{ nav.topic_menu('topic', student_uid) }} {% for p in posts %} {% set score = get_post_score(g.topic, p) %} {% set cls = ['post'] %} {% if seen == None or p.last_change_time() > seen %} {% do cls.append('pnew') %} {% endif %} {% if p.target_uid == -1 %} {% do cls.append('pall') %} {% elif p.author_uid != p.target_uid %} {% do cls.append('pteacher') %} {% endif %}

{%- if p.author_uid < 0 %} Automat {% elif g.course.anon_grading and not g.is_teacher and p.author_uid != g.uid and p.author_uid == student_uid -%} Student {{student_uid}} {% else -%} {{ p.author.full_name() }} {% endif -%} {%- if g.is_admin %} ({{ p.author_role.name }}) {% endif -%} — {% if p.modified != None %} {% set when=p.modified %} modified {% else %} {% set when=p.created %} {% endif %} {{ when|reltimeformat }} {% if g.is_grader and p.author_uid == student_uid and g.topic.deadline != None and when > g.topic.deadline %} (after deadline) {% endif %} {% if g.is_teacher or p.author_uid == g.uid %} — edit {% endif %} — reply {% if p.comment != None %}

{{ p.comment }}
{% endif %} {% if p.attachment != None %} {% set att = attachment_link(p, filename_base) %}

Attachment ({{ p.attachment.split('.')[-1] }}) {% if g.inline_att %} {% if p.attachment_type == 'application/pdf' %}

{% elif p.attachment_type.startswith('image/') %}
{% endif %} {% endif %} {% endif %} {% if score != None %} {% if score.custom_verdict != "" %}

{% endif %} {% if score.custom_verdict != None %} {{ score.custom_verdict }} {% elif g.topic.binary_result %}

{{ "Accepted" if score.points > 0 else "Rejected" }} {% else %}

Points: {{ score.points }} {% endif %} {% if score.sign != None %} {{ score.sign }} {% endif %} {% endif %}

{% endfor %} {% if eval_in_progress %}

Automatic evaluation in progress since {{eval_in_progress.created|reltimeformat(with_abs=False)}}. {% endif %}

Return {% if posts %}
{{ form.csrf_token }} {% if form.ack_time.data %} {{ form.ack_time() }} {% else %} {% endif %}
{% endif %}

New post (You can use Markdown with KaTeX math here)

{{ form.csrf_token }} {% if form.errors['comment'] %}

{{ form.errors['comment'][0] }} {% endif %}

{{ form.comment(rows=16, cols=80) }} {% if form.errors['attachment'] %}

{{ form.errors['attachment'][0] }} {% endif %}

{{ form.attachment.label }} {{ form.attachment() }} {% if g.is_grader and student_uid != -1 %}

{{ form.points.label }} {{ form.points(size=6, accesskey='t') }} {% if g.topic.max_points %} / {% endif %} {% if form.errors['points'] %}

{{ form.errors['points'][0] }} {% endif %} {% endif %}

Preview:

{{ form.submit_button(class='ok', accesskey='s') }}

{% endblock %}