Code Duplication    Length = 5-11 lines in 3 locations

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

@@ 3683-3693 (lines=11) @@
3680
            }
3681
        }
3682
3683
        if (!empty($category_list) && ($show_results || $show_only_score)) {
3684
            //Adding total
3685
            $category_list['total'] = array(
3686
                'score' => $total_score,
3687
                'total' => $total_weight
3688
            );
3689
            echo TestCategory::get_stats_table_by_attempt(
3690
                $objExercise->id,
3691
                $category_list
3692
            );
3693
        }
3694
3695
        if ($show_all_but_expected_answer) {
3696
            $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

@@ 7899-7903 (lines=5) @@
7896
            }
7897
        }
7898
7899
        if (!empty($category_list) && ($show_results || $show_only_score)) {
7900
            //Adding total
7901
            $category_list['total'] = array('score' => $total_score, 'total' => $total_weight);
7902
            echo TestCategory::get_stats_table_by_attempt($this->id, $category_list, $this->categoryMinusOne);
7903
        }
7904
7905
        echo $total_score_text;
7906
        echo $exercise_content;