• Resolved latindj

    (@latindj)


    como puedo ordenar los resultados de forma descendente en la encuesta?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author totalsoft

    (@totalsoft)

    Hello, dear casterln.

    Thank you for contacting us and for reporting your problem.

    To solve your problem, edit our Total-Soft-Poll-Widget.php file. On the line 2388 index.php add

       jQuery('.Total_Soft_Poll_1_Ans_Div_Overlay_InputHid_<?php echo $Total_Soft_Poll; ?>').each(function(){
                    array.push(jQuery(this).val()); 
                 })
                 var SortedArr =  array.sort(function(a, b){return b-a});
                 console.log(SortedArr)
                 var b = SortedArr;
                function count_duplicate(a){
                 for(var i =0; i < a.length; i++){ 
                     if (counts[a[i]]){
                     counts[a[i]] += 1
                     } else {
                     counts[a[i]] = 1
                     }
                    }  
                    for (var prop in counts){
                        if (counts[prop] >= 2){
                        }
                    }
                }
                count_duplicate(SortedArr);
                 for (var i = 0; i < b.length; i++) {
                    for (var prop in counts) {
                        if (b[i] == prop) {
                            if (counts[prop] > 1) {
                                for (var v = 1; v <= counts[prop]; v++) {
                                    if (i != 0) {
                                jQuery('.Total_Soft_Poll_1_Ans_Check_Div' + b[i] +':nth-child('+v+')').remove().insertAfter( jQuery('.Total_Soft_Poll_1_Ans_Check_Div' + b[i - 1]));
                                    }else{
    Plugin Author totalsoft

    (@totalsoft)

      jQuery('.Total_Soft_Poll_1_Ans_Check_Div' + b[i] +':nth-child('+v+')').remove().insertBefore( jQuery('.Total_Soft_Poll_1_Ans_Check_Div:nth-child(1)'));
                            }
                            i++;
                                }
                                
                            }else if(counts[prop] == 1){
                                if (i != 0) {
                                jQuery('.Total_Soft_Poll_1_Ans_Check_Div' + b[i]).remove().insertAfter( jQuery('.Total_Soft_Poll_1_Ans_Check_Div' + b[i - 1]));
                                }else{
                                    jQuery('.Total_Soft_Poll_1_Ans_Check_Div' + b[i]).remove().insertBefore( jQuery('.Total_Soft_Poll_1_Ans_Check_Div:nth-child(1)'));
    
                                }
                            }
                        }
                    }
                 }       
                     })
         </script>

    Thank You.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ORDENAR RESULTADOS DE ENCUESTAS’ is closed to new replies.