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