Code Duplication    Length = 4-5 lines in 3 locations

main/survey/fillsurvey.php 2 locations

@@ 757-761 (lines=5) @@
754
                    ";
755
756
            $result = Database::query($sql);
757
            while ($row = Database :: fetch_array($result)) {
758
                $answer_list['value'] = $row['value'];
759
                $answer_list['group'] = $row['survey_group_pri'];
760
                $results[] = $answer_list;
761
            }
762
763
            //echo '<br />'; print_r($results); echo '<br />';
764
            // Get the total score for each group of questions
@@ 788-792 (lines=5) @@
785
                    ORDER BY temp.survey_group_pri";
786
787
            $result = Database::query($sql);
788
            while ($row = Database::fetch_array($result)) {
789
                $list['value'] = $row['value'];
790
                $list['group'] = $row['survey_group_pri'];
791
                $totals[] = $list;
792
            }
793
            //echo '<pre>'; print_r($totals);
794
795
            $final_results = array();

main/survey/survey.lib.php 1 location

@@ 2426-2429 (lines=4) @@
2423
                GROUP BY option_id, value";
2424
        $result = Database::query($sql);
2425
        $number_of_answers = 0;
2426
        while ($row = Database::fetch_array($result)) {
2427
            $number_of_answers += $row['total'];
2428
            $data[$row['option_id']][$row['value']] = $row;
2429
        }
2430
2431
        $chartData = array();
2432
        foreach ($options as $option) {