Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 3833-3839 (lines=7) @@
3830
                    $category_was_added_for_this_test = true;
3831
                }
3832
3833
                if (isset($objQuestionTmp->category_list) && !empty($objQuestionTmp->category_list)) {
3834
                    foreach ($objQuestionTmp->category_list as $category_id) {
3835
                        $category_list[$category_id]['score'] += $my_total_score;
3836
                        $category_list[$category_id]['total'] += $my_total_weight;
3837
                        $category_was_added_for_this_test = true;
3838
                    }
3839
                }
3840
3841
                // No category for this question!
3842
                if ($category_was_added_for_this_test == false) {

main/exercise/exercise_show.php 1 location

@@ 796-802 (lines=7) @@
793
        $category_was_added_for_this_test = true;
794
    }
795
796
    if (isset($objQuestionTmp->category_list) && !empty($objQuestionTmp->category_list)) {
797
        foreach ($objQuestionTmp->category_list as $category_id) {
798
            $category_list[$category_id]['score'] += $my_total_score;
799
            $category_list[$category_id]['total'] += $my_total_weight;
800
            $category_was_added_for_this_test = true;
801
        }
802
    }
803
804
    // No category for this question!
805
    if (!isset($category_list['none']['score'])) {