Code Duplication    Length = 4-5 lines in 3 locations

main/survey/survey.lib.php 3 locations

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