templates/questionari/rdocente.html.twig line 1

Open in your IDE?
  1. {# 
  2.   
  3.   range#1:insoddisfacente|2:poco soddisfacente|3:neutrale|4:soddisfacente|5:molto soddisfacente
  4.   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 ▶
  5.   Teacher:{"id":"12842","username":"mywebservicetest","name":"mywebservice test"} 
  6.   
  7. #}
  8. {# <h4>{{domanda.posizione}}.</h4> #}
  9. <label for="domanda_{{domanda.id}}">{{domanda.domanda|raw}} {% if domanda.obbligatoria %}* obbligatoria {% endif %}</label>
  10. {% set risposta = risposte[domanda.id].risposta %}
  11. {% set risposta_argomenti = risposta|split("|") %}
  12. {% set ranges = [] %}
  13. {% set argomenti = [] %}
  14. {% set values = "" %}
  15. {% if opzioni|length > 0 %}
  16.   {% set righe = opzioni|split("\n") %}
  17.   {% for riga in righe %}
  18.     {% set thisriga = riga|split("#") %}
  19.     {% if thisriga[0] == "range" %}
  20.       {% set ranges = thisriga[1]|split("|") %}
  21.     {% elseif thisriga[0] == "argomenti" %}
  22.       {% set argomenti = thisriga[1]|split("|") %}
  23.     {% elseif thisriga[0] != "" %}
  24.       {% set teacher = thisriga[0]|split("r:") %}
  25.       {% if teacher[0]=="Teache" %}
  26.         {% set values = teacher[1]|json_decode%}
  27.       {% endif %}
  28.     {% endif %}
  29.   {% endfor %}
  30. <h6>Docente: {{values.name}}</h6>
  31. <table class="table tables-striped">
  32.   <thead>
  33.     <tr>
  34.       <th  class="col-lg-4"></th>
  35.       {% for r in ranges %}
  36.         {% set r2 = r|split(":") %}
  37.       <th scope="col"><center>{{r2[1]}}</center></th>
  38.       {% endfor %}
  39.     </tr>
  40.   </thead>
  41.   <tbody>
  42.     {% set argomento = 1 %}
  43.     {% set index = 0 %}
  44.     {% for a in argomenti %}
  45.       {% if risposta_argomenti[index] is defined %}
  46.         {% set valore_risposta = risposta_argomenti[index]|split(":") %} 
  47.       {% endif %}
  48.     <tr >
  49.       <th scope="row">{{a}}</th>
  50.       {% for r in ranges %}
  51.         {% set r2 = r|split(":") %}
  52.         {% set checked = "" %}
  53.         {% if argomento==valore_risposta[0] %}
  54.           {% if r2[0] == valore_risposta[1] %}
  55.             {% set checked = "checked" %}
  56.           {% endif %}
  57.         {% endif %}
  58.       <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>
  59.       {% endfor %}
  60.     </tr>
  61.       {% set argomento = argomento + 1 %}
  62.       {% set index = index + 1 %}
  63.     {% endfor %}
  64.     
  65.   </tbody>
  66. </table>
  67. {% endif %}