1 <BOUCLE_formulaire(FORMULAIRES){id_formulaire}
>
2 <div class='formidable_analyse'
>
3 [(#REM) On fait un tableau qui contient toutes les réponses, classées par champ ]
6 <BOUCLE_reponses(FORMULAIRES_REPONSES){id_formulaire}
>
7 <BOUCLE_champs(FORMULAIRES_REPONSES_CHAMPS){id_formulaires_reponse}{nom ?= #ENV{nom}}
>
8 #SET_MERGE{liste_valeurs, #GET{valeurs}|table_valeur{#NOM}|sinon{#ARRAY}, #ARRAY{
0,#VALEUR|tenter_unserialize}}
9 #SET_MERGE{valeurs, #ARRAY{#NOM,#GET{liste_valeurs}}}
12 #SET{reponses_total,#TOTAL_BOUCLE}
13 <strong class='nombre_reponse'
>
14 [(#TOTAL_BOUCLE|singulier_ou_pluriel{formidable:reponse_une,formidable:reponses_nb})]
17 <strong class='nombre_reponse'
><:formidable:reponse_aucune:></strong>
20 <BOUCLE_saisies(POUR){tableau #SAISIES|unserialize|saisies_lister_par_nom}
>
21 [(#VAL{saisie}|array_key_exists{#VALEUR}|oui)
22 [(#CLE|=={#ENV{nom,#CLE}}|oui)
23 [(#VALEUR|formidable_analyser_saisie{#GET{valeurs}, #GET{reponses_total}})]
28 </div><!-- formidable_analyse -->
29 <script type='text/javascript'
>
31 $(document).ready(function(){
32 /* Récupérer tous les tableaux d'analyse non décorés */
33 $('.formidable_analyse table:not(.stat_done)').each(function() {
34 $(this).addClass('stat_done');
35 /* Le tableau contient le nombre total d'élément. On parcours chaque valeur */
36 $nbtotal = $(this).data('nombre');
37 $(this).find('td.stat').each(function(){
38 $val = $(this).html();
39 /* Certaines valeurs sont a ignorer (les moyennes) */
40 $ignore = $(this).is('.ignore');
42 /* Calcul du pourcentage */
43 $taux = Math.round($val/$nbtotal*
100);
44 /* On affiche le nombre de réponses */
45 $reponses = $(this).attr('title');
46 if (!parseInt($val) || ($reponses === undefined)) {
49 $reponses =
"<small> - " + $reponses +
"</small>";
52 <div class='[(#CONFIG{formidable/analyse/classe}) ]progress-bar'>\
53 <span></span><strong>" + $taux +
"%" + $reponses +
"</strong>\
55 $(this).html($text).find('span').width($taux + '%');
62 <style type='text/css'
>
63 <INCLURE{fond=css/formidable_analyse.css}
/>