Code Duplication    Length = 5-11 lines in 3 locations

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

@@ 3719-3729 (lines=11) @@
3716
            }
3717
        }
3718
3719
        if (!empty($category_list) && ($show_results || $show_only_score)) {
3720
            //Adding total
3721
            $category_list['total'] = array(
3722
                'score' => $total_score,
3723
                'total' => $total_weight
3724
            );
3725
            echo TestCategory::get_stats_table_by_attempt(
3726
                $objExercise->id,
3727
                $category_list
3728
            );
3729
        }
3730
3731
        if ($show_all_but_expected_answer) {
3732
            $exercise_content .= "<div class='normal-message'>" . get_lang(

main/exercise/exercise_show.php 1 location

@@ 830-837 (lines=8) @@
827
    }
828
}
829
830
if (!empty($category_list) && ($show_results || $show_only_total_score || $showTotalScoreAndUserChoicesInLastAttempt)) {
831
    // Adding total
832
    $category_list['total'] = array(
833
        'score' => $my_total_score_temp,
834
        'total' => $totalWeighting
835
    );
836
    echo TestCategory::get_stats_table_by_attempt($objExercise->id, $category_list);
837
}
838
839
echo $total_score_text;
840
echo $exercise_content;

main/exercise/exercise.class.php 1 location

@@ 8056-8060 (lines=5) @@
8053
            }
8054
        }
8055
8056
        if (!empty($category_list) && ($show_results || $show_only_score)) {
8057
            //Adding total
8058
            $category_list['total'] = array('score' => $total_score, 'total' => $total_weight);
8059
            echo TestCategory::get_stats_table_by_attempt($this->id, $category_list, $this->categoryMinusOne);
8060
        }
8061
8062
        echo $total_score_text;
8063
        echo $exercise_content;