{% load i18n %}
{# A formset is a set of forms which are all combined in one, so we only need one opening
tag #} {{ formset.management_form }} {% for form in formset.forms %} {# TODO: remove need to pass answers. #} {# Some hidden values that I'm passing for now, yes, even passing answers #} {# Will fix this soon so they always come from DB side, but it's just easiest for now. And, does save queries. #} {{ form.answers }} {{ form.lemma }} {{ form.word_id }} {% if forloop.first %}
{% endif %}
{# This is kind of a mess for now #} {% if form.pronoun %} {{ form.pronoun }} {% endif %}
{{ form.pronoun_string }}{{ form.userans }} {# Bound form = form with data; unbound = form with no data #} {% if show_correct %}
    {% for item in form.answer_list_as_list %}
  • {{ item }}
  • {% endfor %}
{% endif %} {% if form.is_bound %} {% if not form.is_valid %}{{ form.userans.errors }}{% else %}{% if form.correct %}{% trans "Correct!"%}{% endif %}{% endif %} {% endif %}
{% if forloop.last %}
{% endif %} {% endfor %} {# TODO: hide show_correct until some words have been submitted. #} {% if not all_correct %} {% else %} {% endif %}
{# Stats #} {% if score %}

{{ score }}/ {{ count }} {% trans "questions correct." %}

{% endif %} {% if all_correct %}

{% trans "All correct!" %}

{% endif %}