Code Duplication    Length = 7-7 lines in 2 locations

main/exercice/exercise.class.php 2 locations

@@ 5598-5604 (lines=7) @@
5595
        }
5596
5597
        // Deleted exercise.
5598
        if ($this->active == -1) {
5599
            return array(
5600
                'value' => false,
5601
                'message' => Display::return_message(get_lang('ExerciseNotFound'), 'warning', false),
5602
                'rawMessage' => get_lang('ExerciseNotFound')
5603
            );
5604
        }
5605
5606
        // Checking visibility in the item_property table.
5607
        $visibility = api_get_item_visibility(
@@ 5621-5627 (lines=7) @@
5618
        // 2. If the exercise is not active.
5619
        if (empty($lpId)) {
5620
            // 2.1 LP is OFF
5621
            if ($this->active == 0) {
5622
                return array(
5623
                    'value' => false,
5624
                    'message' => Display::return_message(get_lang('ExerciseNotFound'), 'warning', false),
5625
                    'rawMessage' => get_lang('ExerciseNotFound')
5626
                );
5627
            }
5628
        } else {
5629
            // 2.1 LP is loaded
5630
            if ($this->active == 0 && !learnpath::is_lp_visible_for_student($lpId, api_get_user_id())) {