Code Duplication    Length = 7-7 lines in 2 locations

main/exercise/exercise.class.php 2 locations

@@ 5927-5933 (lines=7) @@
5924
        }
5925
5926
        // Deleted exercise.
5927
        if ($this->active == -1) {
5928
            return array(
5929
                'value' => false,
5930
                'message' => Display::return_message(get_lang('ExerciseNotFound'), 'warning', false),
5931
                'rawMessage' => get_lang('ExerciseNotFound')
5932
            );
5933
        }
5934
5935
        // Checking visibility in the item_property table.
5936
        $visibility = api_get_item_visibility(
@@ 5950-5956 (lines=7) @@
5947
        // 2. If the exercise is not active.
5948
        if (empty($lpId)) {
5949
            // 2.1 LP is OFF
5950
            if ($this->active == 0) {
5951
                return array(
5952
                    'value' => false,
5953
                    'message' => Display::return_message(get_lang('ExerciseNotFound'), 'warning', false),
5954
                    'rawMessage' => get_lang('ExerciseNotFound')
5955
                );
5956
            }
5957
        } else {
5958
            // 2.1 LP is loaded
5959
            if ($this->active == 0 && !learnpath::is_lp_visible_for_student($lpId, api_get_user_id())) {