{# Shared asks panel — included by booth.html (auto-gallery view) and by asks.html (the standalone page a VERBATIM index.html booth links to, since a verbatim page is served as-is and can never render this inline). #} {# ASKS. A session left multiple-choice questions here for the operator (`.ask.json`). Open ones render as a radio form; answering POSTs to /answer, which writes `.answer.json` for the session to read. Works with JS off — plain form POST. Answered asks show the recorded answer and a collapsed "change" form, since the sidecar is the CURRENT answer. #}
{% for a in asks %}
{% if a.error %}⚠ broken{% elif a.answer and a.answer.complete %}✓ answered{% elif a.answer %}◐ partial{% else %}? open{% endif %} {{ a.stem }}.ask.json{% if a.multi %} · {{ a.questions|length }} questions{% endif %} {% if a.answer and not a.answer.complete %}{{ (a.questions|length) - (a.answer.unanswered|length) }}/{{ a.questions|length }}{% endif %} {% if a.answer %}{{ a.answer.answered_at }}{% if a.answer.answered_by %} · {{ a.answer.answered_by }}{% endif %}{% endif %}
{% if a.error %}

This ask could not be read: {{ a.error }}

{% else %} {% if a.title and not a.multi %}

{{ a.title }}

{% endif %}

{{ a.prompt }}

{% if a.answer %}
{% if a.multi %} {% for q in a.questions %}{% set qa = a.answer.answers.get(q.key) %}
{{ q.prompt }}
{{ qa.label if (qa and qa.choice is not none) else 'left blank' }}
{% if qa and qa.notes %}
{{ qa.notes }}
{% endif %}
{% endfor %} {% else %}
{{ a.answer.label }}
{% endif %} {% if a.answer.notes %}
{{ a.answer.notes }}
{% endif %} {{ a.stem }}.answer.json
{% endif %}
{% if a.answer %}change answer{% else %}answer{% endif %}
{# On the standalone page, come back HERE — the booth's own page is a verbatim report that cannot show the recorded answer. #} {% if asks_page %}{% endif %} {% for q in a.questions %} {% set field = 'choice.' ~ q.key if a.multi else 'choice' %} {% set qa = a.answer.answers.get(q.key) if (a.answer and a.multi) else a.answer %}
{% if a.multi %}{{ loop.index }}. {{ q.prompt }}{% endif %}
{% for o in q.options %} {% endfor %}
{% if q.notes %} {% endif %}
{% endfor %} {% if a.notes %} {% endif %}
{% endif %}
{% endfor %}