Code Duplication    Length = 15-16 lines in 2 locations

main/exercise/exercise.class.php 1 location

@@ 8082-8096 (lines=15) @@
8079
            $learnpath_item_id = $exercise_stat_info['orig_lp_item_id'];
8080
            $learnpath_item_view_id = $exercise_stat_info['orig_lp_item_view_id'];
8081
8082
            if (api_is_allowed_to_session_edit()) {
8083
                update_event_exercise(
8084
                    $exercise_stat_info['exe_id'],
8085
                    $this->selectId(),
8086
                    $total_score,
8087
                    $total_weight,
8088
                    api_get_session_id(),
8089
                    $learnpath_id,
8090
                    $learnpath_item_id,
8091
                    $learnpath_item_view_id,
8092
                    $exercise_stat_info['exe_duration'],
8093
                    '',
8094
                    array()
8095
                );
8096
            }
8097
8098
            // Send notification.
8099
            if (!api_is_allowed_to_edit(null, true)) {

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

@@ 3764-3779 (lines=16) @@
3761
            $learnpath_item_id = $exercise_stat_info['orig_lp_item_id'];
3762
            $learnpath_item_view_id = $exercise_stat_info['orig_lp_item_view_id'];
3763
3764
            if (api_is_allowed_to_session_edit()) {
3765
                Event::update_event_exercice(
3766
                    $exercise_stat_info['exe_id'],
3767
                    $objExercise->selectId(),
3768
                    $total_score,
3769
                    $total_weight,
3770
                    api_get_session_id(),
3771
                    $learnpath_id,
3772
                    $learnpath_item_id,
3773
                    $learnpath_item_view_id,
3774
                    $exercise_stat_info['exe_duration'],
3775
                    $question_list,
3776
                    '',
3777
                    array()
3778
                );
3779
            }
3780
3781
            // Send notification
3782
            if (!api_is_allowed_to_edit(null, true) &&