{#
range#1:insoddisfacente|2:poco soddisfacente|3:neutrale|4:soddisfacente|5:molto soddisfacente
argomenti#1. Domanda1 Lorem Ipsum dolor sit amet ?|2. Domanda2 quasi qualunque come cavare il testo a destra?|3. Domanda3 il testo dunque si alza in confronto a ▶
Teacher:{"id":"12842","username":"mywebservicetest","name":"mywebservice test"}
#}
{# <h4>{{domanda.posizione}}.</h4> #}
<label for="domanda_{{domanda.id}}">{{domanda.domanda|raw}} {% if domanda.obbligatoria %}* obbligatoria {% endif %}</label>
{% set risposta = risposte[domanda.id].risposta %}
{% set risposta_argomenti = risposta|split("|") %}
{% set ranges = [] %}
{% set argomenti = [] %}
{% set values = "" %}
{% if opzioni|length > 0 %}
{% set righe = opzioni|split("\n") %}
{% for riga in righe %}
{% set thisriga = riga|split("#") %}
{% if thisriga[0] == "range" %}
{% set ranges = thisriga[1]|split("|") %}
{% elseif thisriga[0] == "argomenti" %}
{% set argomenti = thisriga[1]|split("|") %}
{% elseif thisriga[0] != "" %}
{% set teacher = thisriga[0]|split("r:") %}
{% if teacher[0]=="Teache" %}
{% set values = teacher[1]|json_decode%}
{% endif %}
{% endif %}
{% endfor %}
<h6>Docente: {{values.name}}</h6>
<table class="table tables-striped">
<thead>
<tr>
<th class="col-lg-4"></th>
{% for r in ranges %}
{% set r2 = r|split(":") %}
<th scope="col"><center>{{r2[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 ranges %}
{% set r2 = r|split(":") %}
{% set checked = "" %}
{% if argomento==valore_risposta[0] %}
{% if r2[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="{{r2[0]}}" {% if domanda.obbligatoria %} class="req" {% endif %}/></center></td>
{% endfor %}
</tr>
{% set argomento = argomento + 1 %}
{% set index = index + 1 %}
{% endfor %}
</tbody>
</table>
{% endif %}