Code Duplication    Length = 5-8 lines in 3 locations

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

@@ 891-897 (lines=7) @@
888
        $sql_query = sprintf($sql, $course['real_id']);
889
        $result = Database::query($sql_query);
890
        $arrLesson = array(array());
891
        while ($row = Database::fetch_array($result)) {
892
            if (empty($arrLesson[$row['session_id']]['lessons_total'])) {
893
                $arrLesson[$row['session_id']]['lessons_total'] = 1;
894
            } else {
895
                $arrLesson[$row['session_id']]['lessons_total'] ++;
896
            }
897
        }
898
899
        /**
900
         *  Exercises

main/survey/survey.lib.php 1 location

@@ 967-974 (lines=8) @@
964
        // Getting the information of the question options
965
966
        $result = Database::query($sqlOption);
967
        while ($row = Database::fetch_array($result, 'ASSOC')) {
968
            /** @todo this should be renamed to options instead of answers */
969
            $return['answers'][] = $row['option_text'];
970
            $return['values'][] = $row['value'];
971
972
            /** @todo this can be done more elegantly (used in reporting) */
973
            $return['answersid'][] = $row['question_option_id'];
974
        }
975
976
        return $return;
977
    }

main/exercice/exercise.php 1 location

@@ 1006-1010 (lines=5) @@
1003
1004
$result = Database::query($sql);
1005
1006
while ($row = Database :: fetch_array($result, 'ASSOC')) {
1007
    $attribute['path'][] = $row['path'];
1008
    $attribute['visibility'][] = $row['visibility'];
1009
    $attribute['comment'][] = $row['comment'];
1010
}
1011
1012
$nbrActiveTests = 0;
1013
if (isset($attribute['path']) && is_array($attribute['path'])) {