Code Duplication    Length = 4-5 lines in 3 locations

main/survey/survey.lib.php 3 locations

@@ 942-946 (lines=5) @@
939
        if ($row['survey_group_pri'] != 0) {
940
            $return['assigned'] = $row['survey_group_pri'];
941
            $return['choose'] = 1;
942
        } else {
943
            $return['assigned1'] = $row['survey_group_sec1'];
944
            $return['assigned2'] = $row['survey_group_sec2'];
945
            $return['choose'] = 2;
946
        }
947
948
        // Getting the information of the question options
949
@@ 1090-1093 (lines=4) @@
1087
                    if (isset($_POST['choose'])) {
1088
                        if ($_POST['choose'] == 1) {
1089
                            $extraParams['survey_group_pri'] = $_POST['assigned'];
1090
                        } elseif ($_POST['choose'] == 2) {
1091
                            $extraParams['survey_group_sec1'] = $_POST['assigned1'];
1092
                            $extraParams['survey_group_sec2'] = $_POST['assigned2'];
1093
                        }
1094
                    }
1095
1096
                    $questionComment = isset($form_content['question_comment']) ? $form_content['question_comment'] : '';
@@ 1133-1137 (lines=5) @@
1130
                            $extraParams['survey_group_pri'] = $_POST['assigned'];
1131
                            $extraParams['survey_group_sec1'] = 0;
1132
                            $extraParams['survey_group_sec2'] = 0;
1133
                        } elseif ($_POST['choose'] == 2) {
1134
                            $extraParams['survey_group_pri'] = 0;
1135
                            $extraParams['survey_group_sec1'] = $_POST['assigned1'];
1136
                            $extraParams['survey_group_sec2'] = $_POST['assigned2'];
1137
                        }
1138
                    }
1139
1140
                    $maxScore = isset($form_content['maximum_score']) ? $form_content['maximum_score'] : null;