{% load i18n %} {% load anonsurvey_extras %}
{% if survey %}

{{ survey.title }}

{{ survey.intro|safe }}

{% if error_messages %}

{% endif %}
{% csrf_token%}
    {% for qg in survey.question_or_group %} {% if qg.0 %}
  1. {{ qg.0.text }}
      {% endif %} {% for q in qg.1 %}
    1. {% if q.requires_answer %}*{% endif %} {{ q.text }}
        {% for a in q.offeredanswer_set.all %}
      • {% if q.question_type == 'I' %} {{ a.prefix }} {{ a.sufix }} {% if a.validation_format %}(format: {{ a.validation_format }}){% endif %} {% elif q.question_type == 'R' %} {{ a.text }} {% elif q.question_type == 'C' %} {{ a.text }} {% elif q.question_type == 'RI' %} {% if a.answer_type == 'I' %} {{ a.prefix }} {{ a.sufix }} {% if a.validation_format %}(format: {{ a.validation_format }}){% endif %} {% else %} {{ a.text }} {% endif %} {% elif q.question_type == 'CI' %} {% if a.answer_type == 'I' %} {% with key=q.id|add:"_value" %} {% with value=last_post|dictget:key %} {{ a.prefix }} {{ a.sufix }} {% if a.validation_format %}(format: {{ a.validation_format }}){% endif %} {% endwith %} {% endwith %} {% else %} {{ a.text }} {% endif %} {% endif %}
      • {% endfor %}
    2. {% endfor %} {% if qg.0 %}
    {% endif %} {% endfor %}
{% else %} {% trans 'No survey' %} {% endif %}