Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 3912-3918 (lines=7) @@
3909
                    $category_was_added_for_this_test = true;
3910
                }
3911
3912
                if (isset($objQuestionTmp->category_list) && !empty($objQuestionTmp->category_list)) {
3913
                    foreach ($objQuestionTmp->category_list as $category_id) {
3914
                        $category_list[$category_id]['score'] += $my_total_score;
3915
                        $category_list[$category_id]['total'] += $my_total_weight;
3916
                        $category_was_added_for_this_test = true;
3917
                    }
3918
                }
3919
3920
                // No category for this question!
3921
                if ($category_was_added_for_this_test == false) {

main/exercise/exercise_show.php 1 location

@@ 854-860 (lines=7) @@
851
        $category_was_added_for_this_test = true;
852
    }
853
854
    if (isset($objQuestionTmp->category_list) && !empty($objQuestionTmp->category_list)) {
855
        foreach ($objQuestionTmp->category_list as $category_id) {
856
            $category_list[$category_id]['score'] += $my_total_score;
857
            $category_list[$category_id]['total'] += $my_total_weight;
858
            $category_was_added_for_this_test = true;
859
        }
860
    }
861
862
    // No category for this question!
863
    if (!isset($category_list['none']['score'])) {