Code Duplication    Length = 5-8 lines in 3 locations

main/survey/survey.lib.php 1 location

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

main/exercise/exercise.php 1 location

@@ 1068-1072 (lines=5) @@
1065
1066
$result = Database::query($sql);
1067
1068
while ($row = Database :: fetch_array($result, 'ASSOC')) {
1069
    $attribute['path'][] = $row['path'];
1070
    $attribute['visibility'][] = $row['visibility'];
1071
    $attribute['comment'][] = $row['comment'];
1072
}
1073
1074
$nbrActiveTests = 0;
1075
if (isset($attribute['path']) && is_array($attribute['path'])) {

main/inc/lib/sessionmanager.lib.php 1 location

@@ 974-980 (lines=7) @@
971
        $sql_query = sprintf($sql, $course['real_id']);
972
        $result = Database::query($sql_query);
973
        $arrLesson = array(array());
974
        while ($row = Database::fetch_array($result)) {
975
            if (empty($arrLesson[$row['session_id']]['lessons_total'])) {
976
                $arrLesson[$row['session_id']]['lessons_total'] = 1;
977
            } else {
978
                $arrLesson[$row['session_id']]['lessons_total']++;
979
            }
980
        }
981
982
        /**
983
         *  Exercises