Code Duplication    Length = 5-11 lines in 3 locations

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

@@ 3670-3680 (lines=11) @@
3667
            }
3668
        }
3669
3670
        if (!empty($category_list) && ($show_results || $show_only_score)) {
3671
            //Adding total
3672
            $category_list['total'] = array(
3673
                'score' => $total_score,
3674
                'total' => $total_weight
3675
            );
3676
            echo TestCategory::get_stats_table_by_attempt(
3677
                $objExercise->id,
3678
                $category_list
3679
            );
3680
        }
3681
3682
        if ($show_all_but_expected_answer) {
3683
            $exercise_content .= "<div class='normal-message'>" . get_lang(

main/exercice/exercise_show.php 1 location

@@ 853-860 (lines=8) @@
850
	}
851
}
852
853
if (!empty($category_list) && ($show_results || $show_only_total_score)) {
854
    // Adding total
855
    $category_list['total'] = array(
856
        'score' => $my_total_score_temp,
857
        'total' => $totalWeighting
858
    );
859
    echo TestCategory::get_stats_table_by_attempt($objExercise->id, $category_list);
860
}
861
862
echo $total_score_text;
863
echo $exercise_content;

main/exercice/exercise.class.php 1 location

@@ 7910-7914 (lines=5) @@
7907
            }
7908
        }
7909
7910
        if (!empty($category_list) && ($show_results || $show_only_score)) {
7911
            //Adding total
7912
            $category_list['total'] = array('score' => $total_score, 'total' => $total_weight);
7913
            echo TestCategory::get_stats_table_by_attempt($this->id, $category_list, $this->categoryMinusOne);
7914
        }
7915
7916
        echo $total_score_text;
7917
        echo $exercise_content;