Code Duplication    Length = 7-7 lines in 2 locations

main/exercise/exercise.class.php 2 locations

@@ 5803-5809 (lines=7) @@
5800
        }
5801
5802
        // Deleted exercise.
5803
        if ($this->active == -1) {
5804
            return array(
5805
                'value' => false,
5806
                'message' => Display::return_message(get_lang('ExerciseNotFound'), 'warning', false),
5807
                'rawMessage' => get_lang('ExerciseNotFound')
5808
            );
5809
        }
5810
5811
        // Checking visibility in the item_property table.
5812
        $visibility = api_get_item_visibility(
@@ 5826-5832 (lines=7) @@
5823
        // 2. If the exercise is not active.
5824
        if (empty($lpId)) {
5825
            // 2.1 LP is OFF
5826
            if ($this->active == 0) {
5827
                return array(
5828
                    'value' => false,
5829
                    'message' => Display::return_message(get_lang('ExerciseNotFound'), 'warning', false),
5830
                    'rawMessage' => get_lang('ExerciseNotFound')
5831
                );
5832
            }
5833
        } else {
5834
            // 2.1 LP is loaded
5835
            if ($this->active == 0 && !learnpath::is_lp_visible_for_student($lpId, api_get_user_id())) {