{# <h4>{{domanda.posizione}}.</h4> #}
<label for="domanda_{{domanda.id}}">{{domanda.domanda|raw}} {% if domanda.obbligatoria %}* obbligatoria {% endif %}</label><br />
{% if opzioni|length > 0 %}
{% if risposte[domanda.id] is defined %}
{% set risposta = risposte[domanda.id].risposta %}
{% else %}
{% set risposta = '' %}
{% endif %}
{% set risposta_argomenti = risposta|split("|") %}
{% set righe = opzioni|split("\n") %}
{# riga 1 e' definito il range, riga 2 sono definiti gli argomenti #}
{% set range = righe[0]|split("#") %}
{% set range = range[1]|split("|") %}
{% set argomenti = righe[1]|split("#") %}
{% set argomenti = argomenti[1]|split("|") %}
<table class="table tables-striped">
<thead>
<tr>
<th class="col-lg-4"></th>
{% for r in range %}
{% set val = r|split(":") %}
<th scope="col"><center>{{val[1]}}</center></th>
{% endfor %}
</tr>
</thead>
<tbody>
{% set argomento = 1 %}
{% set index = 0 %}
{% for a in argomenti %}
{% if risposta_argomenti[index] is defined %}
{% set valore_risposta = risposta_argomenti[index]|split(":") %}
{% endif %}
<tr>
<th scope="row">{{a}}</th>
{% for r in range %}
{% set val = r|split(":") %}
{% set checked = "" %}
{% if argomento==valore_risposta[0] %}
{% if val[0] == valore_risposta[1] %}
{% set checked = "checked" %}
{% endif %}
{% endif %}
<td class="riga_{{domanda.id}}_{{argomento}}"><center><input {{checked}} type="radio" name="domanda_{{domanda.id}}_{{argomento}}" value="{{val[0]}}" {% if domanda.obbligatoria %} class="req" {% endif %} /></center></td>
{% endfor %}
</tr>
{% set argomento = argomento + 1 %}
{% set index = index + 1 %}
{% endfor %}
</tbody>
</table>
{% endif %}