Code Duplication    Length = 5-8 lines in 2 locations

main/survey/survey.lib.php 1 location

@@ 948-955 (lines=8) @@
945
        // Getting the information of the question options
946
947
        $result = Database::query($sqlOption);
948
        while ($row = Database::fetch_array($result, 'ASSOC')) {
949
            /** @todo this should be renamed to options instead of answers */
950
            $return['answers'][] = $row['option_text'];
951
            $return['values'][] = $row['value'];
952
953
            /** @todo this can be done more elegantly (used in reporting) */
954
            $return['answersid'][] = $row['question_option_id'];
955
        }
956
957
        return $return;
958
    }

main/exercise/exercise.php 1 location

@@ 1050-1054 (lines=5) @@
1047
1048
$result = Database::query($sql);
1049
1050
while ($row = Database :: fetch_array($result, 'ASSOC')) {
1051
    $attribute['path'][] = $row['path'];
1052
    $attribute['visibility'][] = $row['visibility'];
1053
    $attribute['comment'][] = $row['comment'];
1054
}
1055
1056
$nbrActiveTests = 0;
1057
if (isset($attribute['path']) && is_array($attribute['path'])) {